How do I find the number of interest periods per year? I am currently self-studying logarithms and exponential equations and the book I am using includes the method of calculating different aspects of the compound interest (compounded amount, starting amount, running time, rate of interest), all other aspects being given.
But the number of interest periods per year is never the unknown in any problem, and the book doesn't deal with solving for it, all other aspects known. In short, my question would be:

How do I find the number of interest periods per year, mathematically how do you solve for $x$ in the equation $$\left(\frac{A}{P}\right)^{(rn)^{-1}}=\left(1+\frac 1x\right)^x$$ all other letters known, or simply solve for $x$ in $$c=\left(1+\frac 1x\right)^x$$

Here is my attempt




*

*$A$ is the compounded amount

*$P$ the principal or starting amount

*$r$ the annual rate of interest

*$n$ the time of compounding in years

*$p$ the number of interest periods annually, and for example it equals $1$ if the compounding happens annually, $2$ if semi-annually, $4$ if quarterly, but this is what we are actually looking for.


As other answers have stated, a “closed form” solution requires using the Lambert W function.  But if you don't have this function available on your calculator or programming library, you may be interested in an approximation.
Some “special” values of $c = (1 + \frac{1}{x})^x$ are:

*

*Annual: $x = 1 \implies c = 2$

*Semiannual: $x = 2 \implies c = 2.25$

*Quarterly: $x = 4 \implies c = 2.44140625$

*Monthly: $x = 12 \implies c \approx 2.613035290224676$

*Weekly: $x = 52.1775 \implies c \approx 2.692682824117828$

*Daily: $x = 365.2425 \implies c \approx 2.7145699419617033$

*Continuously: $x \rightarrow \infty \implies c \rightarrow e \approx 2.718281828459045$
After playing with these numbers a bit, I found a simple rational function that approximates the above values.  (Coefficients are for least-squares error on $\frac{1}{x}$.)
$$x = \frac{1}{1.14962209188153(e-c)^2 + 0.55980701470039(e-c)}$$
This gives correct (to the nearest integer) results for $1 \le x \le 6$, but works less well for more frequent compounding.
