First year is 30,000.
Earn 5% raise every year.
Growth factor is 1.05 this sounds a lot like a geometric ratio.
An = A1 × r^(n-1)Sn = A1 × (1 - r^n) / (1-r)n = 40
A1 = 30,000
A40 = $30,000 * 1.05^39 = $201,142.53
S40 = A1 * (1 - 1.05^40) / (1-1.05) which becomes:
S40 = 30,000 * -6.039988712 / -.05 which becomes:
S40 = -181,199.6614 / -.05 which becomes:
S40 = $3,623,993.227
The individual yearly calculations are shown below: