N = [ - log ( 1 - [ ( r*A ) / P ] ) ] / ( log (1+r) )
Where,
N = Number of Payments
r = Rate of Interest (compounded)
A = Loan Amount
P = Payment Amount