Small (~10): The Sieve of Eratosthenes finds primes and also does a decent job demonstrating the “pattern” that they form. If you mark every multiple of 2, you’ll be marking only composite numbers. Turns out that if n isn’t prime, then neither is M n . Create the sequence of numbers, S k , defined recursively as S k = (S k-1 )2 – 2 with S 0 = 4. Answer Gravy: Fermat’s little theorem is pretty easy to use, but it helps to see an example.