The principal amount is P, rate of interest is R and time of loan is T
If an amount 'P' is borrowed for 'n' years at r% per annum compounded annually, and x is the installment that is paid at the end of each year, starting from the first year, then:
$$P\ =\ \dfrac{\ x}{1+\dfrac{r}{100}}+\ \dfrac{\ x}{\left(1+\dfrac{r}{100}\right)^{^2}}+...+\ \dfrac{\ x}{\left(1+\dfrac{r}{100}\right)^{^n}}$$
or
$$P\ \left(1+\frac{r}{100}\right)^{n\ }=\ x\ \left(\left(1+\frac{r}{100}\right)^{n-1}+\left(1+\frac{r}{100}\right)^{n-2\ }...\ +1\right)$$