Let P = the amount of money deposited at the beginning of the first year (unknown)
Let W = the amount that is withdrawn at the beginning of each year starting the second year. ($40,000)
Interest = 8% and 1.08 is the total yearly amount after interest has been applied. So, a table of the beginning and end of the year would look like this....
First of year End of Year
First year Deposit of W 1.08W
Second Year 1.08P - W 1.082P - 1.08W
Third Year 1.082P-1.08W-W 1.083P-1.082W-1.08W
Fourth Year 1.083P-1.082W-1.08W-W You can see the trend and we want the total money to
be zero at the beginning of the 16th year after the last $40,000 is removed!
So, the series up to the 16th year is as follows:
Sum = 1.0815P -1.0814W-1.0813W- ..................... - 1.08W-W
= 1.0815P -W{ 1.0814 + 1.0813 + ............. + 1.08 + 1 }
If you sum what is in the brackets, you obtain (1.0815 -1)/(.08) = 27.152 (Details not shown here)
Substituting, we get Sum = 1.0815P - 27.152W and this will be zero
So 1.0815P = 27.152(40,000) = 1,086,080
Solving for P we have P = $342,377.71
There are also standard formulas to make this calculation but I thought you may find it interesting to see where those formulas come from!