You want enough money at retirement in order to pay yourself 100000/year for 30 years, and have the 100000 payment increase each year at the rate of inflation, 3%/year. Assume r=4.5%.
How much money would you need at retirement if you also want to leave 1000000 to your heirs in 30 years?