The Mathematical Intelligencer

, Volume 41, Issue 4, pp 10–12

# On Generalizing a Corollary of Fermat’s Little Theorem

Article
A friend who teaches middle-school math recently asked me whether it was a coincidence that every positive integer and its fifth power seem to have the same last (i.e., rightmost) decimal digit. I said that it was definitely not a coincidence and that it followed from a theorem in number theory called Euler’s theorem, which I explained briefly. Right after this, however, I recalled that since the theorem applies only to numbers that are relatively prime to the modulus (which is 10 in this case, since dividing any positive integer by 10 and taking the remainder gives us that integer’s last digit), the theorem applies only to numbers ending in 1, 3, 7, or 9, and cannot be applied to numbers ending in 0, 2, 4, 5, 6, or 8, since they are not relatively prime to 10. Nonetheless, we can easily check that in this case, his observation works for all these numbers as well: $$2^5=32$$

## References

1. 
2. 
J. H. Silverman. A Friendly Introduction to Number Theory, fourth edition. Pearson Prentice Hall, 2013.Google Scholar