Cicadas are flying, plant-eating insects. Most cicada species have life cycles that span 2 to 8 years. They spend most of their lives underground before emerging as adults. In a few species, almost all the individuals in a given location come out of hiding at the same time. These are known as periodical cicadas, and they generally belong to the genus *Magicicada*.

Periodical cicadas usually have 13- or 17-year life cycles. Their development is so synchronized that practically no adults are present in the 12 or 16 years between emergences. When these cicadas do come out of their underground homes, they appear in huge numbers and create a cacophonous, throbbing din during their brief period of mating frenzy in the open air.

Curiously, 13 and 17 are both prime numbers, evenly divisible only by themselves and 1. The fact that periodical cicadas emerge after a prime number of years could be just a coincidence. Or it might reflect some sort of evolutionary pressure that leads to prime-number cycles.

For example, prime cycles might occur so that periodical cicadas can more readily evade shorter-lived predators or parasites. If periodical cicadas had 12-year life cycles, all predators with 2-, 3-, 4-, or 6-year cycles would get a chance to eat them, potentially wiping out an entire population. With prime-number cycles, the chances of predator and prey coinciding would be much less.

A few years ago, Mario Markus of the Max Planck Institute for Molecular Physiology in Dortmund, Germany, and his coworkers decided to see whether such prime-number cycles could come out of a simple evolutionary mathematical model of interactions between predator and prey.

In such a mathematical model, predator and prey have randomly assigned life-cycle durations. If cicadas appear when many predators are waiting, their population drops. If cicadas come out when few predators are around, they flourish. In the meantime, random “mutations” change the life-cycle durations of succeeding generations, subject to the requirement that the predator’s life cycle stays shorter than that of the prey.

The researchers observed that, in their simulations, a sequence of mutations would eventually lock the cicadas (prey) into a stable prime-number cycle.

The fact that a simple predator-prey mathematical model leads to prime-number cycles, however, doesn’t really explain why periodical cicadas have 13- or 17-year cycles. For one thing, no one has yet identified predators or parasites that would fit the bill biologically. Moreover, the model says nothing about why many species have cycles that are not prime numbers.

Interestingly, the mathematical model developed by Markus and his colleagues can serve as a machine for generating prime numbers. Starting with a cycle of any length, the steps of their procedure inevitably lead to a prime number.

It’s not a particularly efficient way to generate a prime number, but it certainly does the job.

“The remarkable feature of the present work, however, is the biological rationale underlying the prime-generating algorithm,” Markus and his coworkers reported in a paper describing their work. “Our algorithm displays the merging of two seemingly unrelated subjects: number theory and population biology.”