How to get power by knowing the number and result

How to get power by knowing the number and result.

For Example

$$2^n = 8$$

how can i return the power $n$ by knowing number $2$ and result $8$

or

$$4^n = 1024$$

how can i return the power 'n' by knowing number $4$ and result $1024$

Is there any formula

Thanks

That is what the logarithm is for. If $a^b=c, b=\log_a c$ There are many rules for manipulating logarithms. In your examples, $\log_2 8=3, \log_4 1024=5$

Divide the number (in your case 8), repeatedly (in fact, n number of times) by the base (which is 2).

• Thanks....................+1 – Hussain Nasif Feb 12 '14 at 14:14

In the case of:

$$2^n = 8$$

We can simply rewrite 8 as a power of $2$:

$$2^n=2^3$$

As the bases are the same, we can drop the $2$ on both sides leaving us with:

$$\boxed{n=3}$$

The same can be applied in the case of $4^n = 1024$ as we are again dealing with nice numbers.

$$4^n=1024\\4^n=4^5\\\boxed{n=5}$$