From the Wikipedia:
The fixed monthly payment for a fixed rate mortgage is the amount paid by the borrower every month that ensures that the loan is paid off in full with interest at the end of its term. The monthly payment formula is based on the annuity formula. The monthly payment c depends upon:
r - the monthly interest rate, expressed as a decimal, not a percentage. Since the quoted yearly percentage rate is not a compounded rate, the monthly percentage rate is simply the yearly percentage rate divided by 12; dividing the monthly percentage rate by 100 gives r, the monthly rate expressed as a decimal.
N - the number of monthly payments, called the loan's term, and
P - the amount borrowed, known as the loan's principal.
In the standardized calculations used in the United States, c is given by the formula: $$c = \begin{cases} \frac{r P}{1-(1+r)^{-N}} = \frac {rP(1+r)^N}{(1+r)^N-1}, & r\ne 0; \\ \frac{P}{N}, & r = 0. \end{cases}$$
The "issue" with this monthly payment schedule is that, if inflation is positive, the amount you pay in real terms the first year is more than the amount you pay the last year. Assuming constant inflation $\pi$, what would the monthly payment formula look like if it had to be constant in real terms?