# Fun results from modular arithmetic

I'm trying to go through various bits of neat, fun math with some junior-high-school students in my local area, and am thinking of doing a short unit on modular arithmetic/finite groups.

I'm looking for some fun number facts that can be shown using modular arithmetic. For example, the fact that the sum of three cubes can't be a multiple of 9 +/- 4.

Any such fun tidbits people could point me to would be very much appreciated.

• This isn't really a "number fact", but a description of RSA and a proof that it works would be an interesting, motivated result. – Henry Swanson Nov 10 '14 at 18:17

You probably know this, but the fact that the remainder of a number modulo $9$ is the same as that of the sum of its digits is a simple calculation involving powers of $10 = 1$. There's a similar formula modulo $11$, where $10 = -1$.
Also, the fact that if $2^n - 1$ is prime (a Mersenne prime), then $n$ is prime. If $n = ab$, then reduce $2^n - 1$ modulo $2^a - 1$, where you have $2^a = 1$.