The payment change (payment to recover CPI premium) uses the standard amortization formula (remember this requires a scientific calculator to calculate the exponent ^):
 
(r*v)/(1-(1+r)^-n)
 
r = monthly rate
v = value (i.e. CPI premium)
n = # payments
 
The number of payments to amortize is the lesser of the CPI term (from system configuration) or the number of payments left on the loan.