Log in to Mathigon

Create New Account

Reset Password     


Change Language


Send us Feedback

Please let us know if you have any feedback and suggestions, or if you find any errors and bugs in our content.

Sorry, your message couldn’t be submitted. Please try again!

Thanks for your feedback!

Reset Progress

Are you sure that you want to reset your progress, response and chat data for all sections in this course? This action cannot be undone.


Select one of the keywords on the left…

Divisibility and PrimesReal Life Applications

Reveal All Steps


North America is home to various broods of cicadas. These have the curious property that they only emerge every few years during the summer to breed – the remaining time they spend underground.

For example, the cicadas in Florida and Mississippi appear every 13 years. The cicadas in Illinois and Iowa only appear every 17 years. But there are no cicadas with 12, 14, 15 or 16 year cycles.

Both 13 and 17 are prime numbers – and that has a very good reason. Imagine that there are predators in the forest which kill cicadas. These predators also appear in regular intervals, say every 6 years.

Now imagine that a brood of cicadas appears every ${n} years (${isPrime(n) ? 'prime' : 'not prime'}). The two animals would meet every ${lcm(n,6)} years, which is the lcmgcfproduct of 6 and ${n}.

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Time until cicadas and predators meet, for various different cicada cycle lengths.

This number seems to be much larger if the cicada cycle is a prime number like 13 and 17. That’s because prime numbers don’t share any factors with 6, so when calculating the lcm we don’t cancel any duplicate factors.

Of course, cicadas have no idea what prime numbers are – but over millions of years, evolution has worked out that prime cycles are the safest. The predator animal seems to have gone extinct over time, but the prime number cycles remain.


One of the most important modern applications of prime numbers is in a field of mathematics called Cryptography. For thousands of years, people have tried to conceal messages so that only the intended recipient could read them – this is called encryption. It is used by everyone from generals exchanging secret orders during wars to personal emails or online banking details.

People always tried to come up with better, more secure encryption methods, but after some time, they were all broken using yet more advanced algorithms. In the Second World War, the German army used the Enigma: a complex machine consisting of a keyboard, rotating wheels and plugs. It encrypted messages using one of 158 million million million possibilities (that’s a 158 followed by 18 zeros!). The code was widely believed to be unbreakable, but the British Secret Service, led by mathematician Alan Turing, built some of the first computers that managed to decode it.

German four-rotor Enigma machine

Today’s computers are much more advanced, capable of trying millions of possibilities every second. To develop better encryption algorithms, you have to find a mathematical operation that is difficult even for powerful computers. Computers are incredibly fast at addition, subtraction, multiplication and division. However, as it turns out, computers are very slow at factorising large integers into primes…

COMING SOON – RSA example with Alice and Bob

This encryption algorithm is called RSA Cryptography, after its three inventors, Ron Rivest, Adi Shamir and Leonard Adleman who published it in 1977. It turns out that a very similar method was known to the British Secret Service since 1973, but remained classified until much later.

Today, prime numbers are used by computers all over the world to exchange data. As you browse the internet or send chat messages, your phone or laptop will quietly generate large prime numbers and exchange public keys with other computers.