Using the example for an ordinary annuity from here:-
Calculating The Present And Future Value Of Annuities
The example demonstrates how a present value principal of 4329.48 is paid down by five repayments of 1000 each discounted to present value by the interest rate and period.

The calculation can be represented by the following summation:

where p
is the principal, d
is the periodic payment, r
is the periodic interest rate and n
is the number of periods.
By induction this can be converted to a standard formula.
Mathematica does the induction calculation automatically:

p = (d - d (1 + r)^-n)/r
∴ d = (p r)/(1 - (1 + r)^-n)
Substituting your figures with variations, since 2% is rather high for a weekly rate and more typical of an annual rate.
principal, p = 5000
number of periods, n = 52
for annual effective rate of interest = 2%
weekly rate, r = (1 + 0.02)^(1/52) - 1 = 0.000380892
d = (p r)/(1 - (1 + r)^-n) = 97.1275
So with a 2% annual effective rate of interest the weekly instalment is 97.13
for an annual nominal rate of 2% compounded weekly
weekly rate, r = 0.02/52 = 0.000384615
d = (p r)/(1 - (1 + r)^-n) = 97.1371
With a 2% nominal rate compounded weekly the weekly instalment is 97.14
Alternatively, with periodic (weekly) rate, r = 2% = 0.02
d = (p r)/(1 - (1 + r)^-n) = 155.545
With a weekly rate of 2% the annual effective rate is (1 + 0.02)^52 - 1 = 180% per annum
and the weekly instalment is 155.55
inst
unspecifiedamt
is a symbolic expression that grows larger and larger with each iteration. (And you are trying to print this big thing to the screen every time). Try runninfg withnlast=10
and you'll see.. $\endgroup$ – george2079 Mar 1 '16 at 20:302%
every week" could mean an annual effective interest rate of 180% p.a. depending on interpretation.(1 + 0.02)^52 - 1 = 1.8003
. Do you mean an annual effective rate of 2%, or a nominal rate of 2% compounded weekly? (see link) $\endgroup$ – Chris Degnen Mar 2 '16 at 12:01