Formula for the amount of an annuity
An annuity is a fixed sum of money paid at regular intervals.
Amount of an annuity:
P = sum deposited at the end of each year (beginning one year from when the annuity "starts")
r = the interest rate, as a decimal (5%, for example, is r = 0.05)
n = number of years the annuity has run
N = total amount accumulated at the end of n years.
N = (P/r)( (1 + r)n - 1)
So if $5000 is deposited yearly for 20 years at 5%,
N = (5000/0.05)( (1 + 0.05)20 -1) = 100,000(2.6533 -1) = $165,330
See also the formula for the present value of an annuity