Power of very big numbers

1.3k Views Asked by At

So, I was solving a question, and I came across this.

If I have, x=a^b, and If I want to calculate the last digit of x, then it will be equivalent to the power of the last digit of a powered to b.

For example, the last digit of

56^78 will be equal to the last digit of 6^8.

75^74 wil be equal to the last digit of 5^4.

Am I right in saying this? This seems to be correct for all cases. Is this right?

PS: This will be useful if I wish to calculate the last digit of very big numbers. ( like having 1000 digits or so)

2

There are 2 best solutions below

3
On

More precisely, the last digit of $x = a^b$ will be the last digit of the number given by the last digit of $a$ raised to the power of $b$.

This is easy to prove. In base $10$ notation, let $a = 10^na_n + 10^{n-1}a_{n-1} + ... + 10a_1 + a_0$.

Now $x = a^b \equiv a_0^b \pmod {10}$.

EDIT: just wanted to add that there's nothing special about base $10$. It will work in any base, as long as the same base is used throughout. I just used decimal notation for convenience because that's the usual convention.

Another edit: Sorry, just read your question more carefully (I think Andre also skimmed over that the first time. :) ). You cannot take just the last digit of $b$. You have to consider the entire exponent. However, you can take just the last digit of $a$.

1
On

No, this is not correct. For example, The last digit of $2^{10}=1024$ is $4$, but the last digit of $2^0$ is 1. There are many small counter examples; three more are $13^{14}$, $3^{11}$, and $12^{12}$.