I'll start by presenting it as a hypothetical problem:

After studying for 3 years at university I have student debt of 65224. My interest rate is 3.15%, inflation is assumed to be 3% each year so the above inflation interest is 0.15%, I pay back 90 a year (let's call these payments deductions) and we assume that the payments rise with the rate of inflation. After 30 years, any remaining debt is wiped.

What is the best way to work out, after 30 years, what percentage of my original debt I have paid in inflation interest, above inflation interest, and deductions?

I have my own way of doing it but it is extremely long winded so I don't think it's the best way.

I start with above inflation interest = 65224*(3/2000) = 98,

then inflation = 1957,

then deductions from debt = 65224 - (90*1.03) = 65131,

I then repeat the process starting with 65131,

Meanwhile I have a separate tally of what the above figures are after 30 years of inflation,

so I'll multiply each of the above figures by 1.03^remaining years of inflation.

I'll then sum up these inflated figures and divide the sum by 65224*(1.03^30) to see what each element added up to as a percentage of the original debt post inflation.

It's based on some optimistic assumptions, I know but I'm just trying to get an idea. I hope it all makes sense too.