M = P [ r(1+r)^n ] / [ (1+r)^n - 1 ] where P = loan amount, r = monthly interest rate (annual rate / 12), n = number of payments (years * 12).