Real-world examples of periodical species range from cicadas, whose life cycles are large prime numbers, like 13 or 17, to bamboos, whose periods are large multiples of small primes, like 40 or even 120. The periodicity is caused by interaction of species, be it a predator-prey relationship, symbiosis, commensalism, or competition exclusion principle. We propose a simple mathematical model, which explains and models all those principles, including listed extremal cases. This rather universal, qualitative model is based on the concept of a local fitness function, where a randomly chosen new period is selected if the value of the global fitness function of the species increases. Arithmetically speaking, the different interactions are related to only four principles: given a couple of integer periods either (1) their greatest common divisor is one, (2) one of the periods is prime, (3) both periods are equal, or (4) one period is an integer multiple of the other.