On the last digit of a power

996 Views Asked by At

In the decimal system the last digit of a whole number is the same as the last digit of its fifth power. For example, $$\underline{2}^5=3\underline{2},$$ $$\underline{3}^5=24\underline{3}$$ and $$\underline{4}^5=102\underline{4}.$$ Is a similar statement true for some powers for other base systems? Does it follow from Fermat's little theorem?

2

There are 2 best solutions below

3
On BEST ANSWER

Whenever $p>1$ is a squarefree integer, we have $$a^{\lambda(p)+1}\equiv a\mod p$$ for all non-negative integers $a$, hence for every squarefree base $p$, there are examples. $\lambda(n)$ denotes the Carmichael-function.

0
On

Yes, for the base $b=10=2\cdot 5$ it follows from Fermat's little theorem: $a^5\equiv a\pmod{5}$ and $a^2\equiv a\pmod{2}$ (which implies that $a^5\equiv a\pmod{2}$). Hence $a^5\equiv a\pmod{2\cdot 5}$.

In a similar way, if $b$ is the product of distinct primes $p_1, p_2,\dots, p_r$ with $r>0$, then $a^{p_i}\equiv a\pmod{p_i}$ for $i=1,\dots, r$ and for $m=\text{lcm}(p_1-1,p_2-1,\dots,p_r-1)+1>1$ it follows that $a^m\equiv a\pmod{b}$.