Find the last five digits of the number $5^{1981}$
I know that the last three digits are $125$ because the last three digits tends to be $125$ or $625$. Since $1981$ is odd, the last three digits are $125$. But how do I find the last five digits?
Find the last five digits of the number $5^{1981}$
I know that the last three digits are $125$ because the last three digits tends to be $125$ or $625$. Since $1981$ is odd, the last three digits are $125$. But how do I find the last five digits?
Per @lulu's comment, to find $5^{1981} \operatorname{mod} 10^5$, it suffices to find $5^{1981} \operatorname{mod} 2^5$ and $5^{1981} \operatorname{mod} 5^5$. The latter is obviously 0, so it suffices to work out the former.
Let's try repeated squaring.
And this is enough to work out $5^{1981} = (5^8)^{247} \times 5^4 \times 5 = 1 \times 17 \times 5 = 21$ (modulo 32).
So now we need a number that's simultaneously equal to 0 modulo $5^5 = 3125$ (i.e., is a multiple of 3125) and equal to 21 modulo 32. And we don't have to look far, because it turns out that 3125 itself meets that condition.
Therefore, the last 5 digits of $5^{1981}$ are 03125.
Using Dan's solution above, it's also possible to calculate 5^1981 modulo 32 by using Euler's Totient function. 5^(1981 modulo ϕ(32)) = 5^13 = 5 * (5^3)^4 = 5 * (-3)^4 = 5 * 81 = 5 * 17 = 85 = 21 (mod 32)
The rest follows Dan's solution.