Mathematic formula for increasing a number by a percentage every other time

650 Views Asked by At

I'm trying to create a formula where a number is increased by a certain percentage, then next calculation it is not, then the next calculation it is, then the next calculation it is not... Basically a pattern of increasing a number every other time the calculation is run. Here is an example:

Starting amount: $\$100,000$

Bi-Annual Percentage Increase: $25\%$

Year 1 Calculation: $\$100,000 * (1+.25) = \$125,000$

Year 2 Calculation: $\$125,000$ (stays the same as previous year)

Year 3 Calculation: $\$125,000 * (1+.25) = \$156,250$

Year 4 Calculation: $\$156,250$ (stays the same as previous year)

and so on...

Isn't there a formula to perform this calculation for a set amount of years?

Thanks.

2

There are 2 best solutions below

0
On

Of course there is, using exponentiation and the floor function.

The floor function $\lfloor x\rfloor $ gives you the largest integer $n$ such that $n\leq x$.

If $x$ is a natural number then it is either even or odd.

  • If it is even it has the form $x=2n$ in which case $x/2=n$ is an integer and hence $\lfloor n\rfloor=n$.

  • If it is odd then $x=2n+1$ and so $x/2=n+1/2$, and hence $\lfloor n+1/2\rfloor=n$

As we want the increase to happen when $n$ is odd we need to add the extra $+1$ to make up for this. The resulting function is then $$100,000\cdot (1+0.25)^{\lfloor (n+1)/2\rfloor}$$ where $n$ denotes the number of years that have passed.

4
On

The function is

$a(n)=\begin{cases} 100,000\cdot (1.25)^{n/2}, \text{ if n is even} \\ 100,000\cdot (1.25)^{(n+1)/2}, \text{ if n is odd}\end{cases} $

Numerical example:

For $n=5$ (odd) the amount of money is $100,000\cdot (1.25)^{(5+1)/2}=100,000\cdot (1.25)^{3}=\$195,312.5$