I have very difficult problem (for me)
I have to create a pension calculator.
What I know is:
I am now 30 years old, will stop paying as I am 60 (so I will pay over 30 years) and I will live about 30 years.
I want to get about 1000 € per month pension BUT including the 2.5 % inflation.
So when I am 60, what is currently 1000 € will be ca. 2097 € and when I am 90, 1000 € today will be ca. 4399 €
Now the question, how much money do I need to get enough money?
It is about 1.157.864 € but I have not calculated the interest of 4.5 % on my money. So it must be less then 1.157.864 €.
My head is exploding....
So, the right question is, how much money I need to havewhen I am 60 to get my last years about 4399 € a month.
Then is the question how my I have to pay monthly to get this amount. And how to calculate it!
If some one can help me, it will be great!
So given a retirement age, a death age, a monthly pension amount, an inflation rate, and an interest rate you want to find out how much money a person would need at retirement to take out the pension amount each month until death.
First, use the inflation rate c and interest rate i to find the effective monthly interest rate x. You need $$\left(1+x\right)^{12}=\frac{1+i}{1+c}$$ and so $$x=\left(\frac{1+i}{1+c}\right)^{1/12}-1$$
In your example, $x\approx0.00161.$ Next, find the number of months $m=12(a_d-a_r).$ (This assumes you retire and die on the same day of different years; you can tweak this as needed if you want to assume, say, retirement in January and death in December.)
For convenience, define $\lambda=1/(1+x)$ as the rate at which future months become cheaper in interest-inflation adjusted terms.
Now the total amount you need is $$\sum_{k=0}^{m-1}p\cdot\lambda^k=p\frac{1-\lambda^m}{1-\lambda}$$
If you want to put that in present dollars rather than retirement year dollars, divide by $(1+c)^y$ where y is the difference between the retirement year and this year.
In your example, that's €273,420.
You could find monthly payments the same way, but I don't recommend that! Earning power is not constant over one's life.