John wants a $200,000 house. He is 40 and he retires at 65. He believes he earns 9% annually after taxes. How much must John invest at the end of each of the next 25 years to have the cash purchase price of the house when he retires?

amount = payment[(1+i)^n - 1]/i

200000 = paym[1.09)^25 - 1]/.09
200000 = paym[84.700896]
paym = 200000/84.700896
= 2361.25