P ==> Loan amount (principal)

E ==> EMI per month (to be derived)

n ==> tenure in months

R ==> rate of interest per month (to avoid cluttering of derivations, R is assumed to have been divided by 100. ie., for 12% p.a interest rate, it is 1% per month, so R is 0.01)

Let us derive the formula for outstanding-principal at the end of n EMIs (months):

outstanding-principal after month n = outstanding-principal after month n-1 minus principal component of the n'th EMI.

First month: P-(E-P*R) ==> P-E+PR ==> P(R+1)-E

Second month (n=2):

=> P-(E-PR)-(E-(P-E+PR)*R) => P-E+PR-(E+ER-(P+PR)*R) => -E-E-ER + P + PR + (P+PR)*R

=> -2E-ER + (P+PR)(1+R) => -E(R+2) + P(1+R)(R+1) = P(R+1)

^{2}- E(R+2)

Third month (n=3):

=> P(R+1)

^{2}- E(R+2) - E + PR(R+1)

^{2}- ER(R+2)

=> P(R+1)

^{2}+ PR(R+1)

^{2}-E -E(R+2) -ER(R+2) ==> P(R+1)

^{3}- E(1+(R+2)(1+R))

Fourth month (n=4):

=> P(R+1)

^{3}- E(1+(R+2)(R+1)) - E + PR(R+1)

^{3}- ER(1+(R+2)(R+1))

=> P(R+1)

^{4}-E -E(1+(R+2)(R+1)) -ER(1+(R+2)(R+1))

=> P(R+1)

^{4}- E(1+(1+(R+2)(R+1))(R+1)) -------- (1)

Clearly the first portion of the outstanding principal has become a function of 'n'. I had to formulate the second portion ie., the co-efficient of E -> (1+(1+(R+2)(R+1))(R+1)) so I can come up with a outstanding-principal formula after n EMIs.

First approach:

1 ==> (R+1)

^{0}

R+2 ==> (R+1)

^{0}+ (R+1)

^{1}

1+(R+2)(R+1) == > 1 + R

^{2}+ R + 2R+2 ==> (R+1)

^{0}+ (R+1)

^{1}+ (R+1)

^{2}

1+(1+(R+2)(R+1))(R+1) ==> 1 + ((R+1)

^{2}+R+2)(R+1)) == > 1 + ((R+1)

^{3}+(R+2)(R+1))

==> (R+1)

^{0}+ (R+1)

^{1}+ (R+1)

^{2}+ (R+1)

^{3}

This translates to something like a

^{0}+a

^{1}+a

^{2}+a

^{3}...+a

^{n}; but I have no idea of any means to change this to a simple function of n.

So tried another approach to deduce:

R+2 => (R

^{2}+2R+1-1)/R ==> ((R+1)

^{2}-1)/R

1 + (R+2)(R+1) ==> 1 + ((R+1)

^{2}-1)*(R+1)/R ==> 1 + ((R+1)

^{3}-R-1)/R

==> 1 + ((R+1)

^{3}-1)/R - 1 == > ((R+1)

^{3}-1)/R

Similarly it can also be proved that for n=4 it is ((R+1)

^{4}-1)/R

Proof my mathematical induction:

Lets call this function P(k):

P(1) = ((R+1)

^{1}-1)/R => R+1-1/R => 1

Assuming P(k) is true, lets prove p(k+1).

based on the above recurrence, p(k+1) = 1+(R+1)P(k)

==> 1+(R+1) * ((R+1)

^{k}-1)/R ==> 1 + ((R+1)

^{(k+1)}-(R+1))/R

==> 1 + ((R+1)

^{(k+1)}-1)/R - 1 ==> ((R+1)

^{(k+1)}-1)/R ==> P(k+1)

Substituting the result in equation (1), the outstanding principal after n EMIs is: => P(R+1)

^{n}- E((R+1)

^{n}-1)/R

For the loan to end correctly, the outstanding principal at the end of n EMIs should be less than or equal to zero (if -ve, last month EMI will be smaller appropriately).

P(R+1)

^{n}- E((R+1)

^{n}- 1)/R <= 0 or E >= P(R+1)

^{n}/ (((R+1)

^{n}- 1)/R) or

E >= PR(R+1)

^{n}/ ((R+1)

^{n}-1)

EMI has to be as small as possible while completing the loan on time. So, computationally, for E to be a smallest possible round integer, >= can be converted to = by doing a ceil on the result.

So, E = ceil(PR(R+1)

^{n}/ ((R+1)

^{n}-1))

where ceil(x) ==> smallest integer that is >= x e.g, ceil(1.5) = 2; ceil(2.1) = 3; ceil(2) = 2;

Hence proved :)