My colleague Mercedes McGowen has been experimenting with iterated squaring modulo a prime and has, to date, been unable to find a pure cycle of length 5.

Mercedes was originally inspired by A. K. Dewdney’s article “Computer recreations: A computer microscope zooms in for a look at the most complex object in mathematics;”, Scientific American. August, 1985. pp. 16-24 :

“Confronted with infinite complexity it is comforting to take refuge in the finite. Iterating a squaring process on a finite set of ordinary integers also gives rise to interesting structures. The structures are not geometric but combinatorial.”

A clue came unexpectedly from a recent arxiv paper of Roger Heath-Brown.

Recall that if is prime then the *multiplicative order* of in the field of integers modulo is the least integer such that .

Heath-Brown remarks (p. 2) that if is the squaring map then for , with odd multiplicative order , there is a pure cycle of length for the iterates of where is the multiplicative order of .

So if we want a pure cycle for iterated squaring of length 5 then we choose and seek a prime for which has an element of multiplicative order 31.

As one readily checks, through a computational search, the prime 311 has this property: namely 265 has multiplicative order 31 in .

The pure cycle of order 5 for the squaring map in is

meaning that and .

A further search indicates the same is true for the prime 373: a 5-cycle for the squaring map in is .

In fact there are 6 such 5-cycles for :

Here’s a short list of primes for which has a 5-cycle in :

311, 373, 683, 1117, 1303, 1427, 1489, 1613, 1861, 2357, 2543, 2729, 2791, 3163, 3659, 3907, 4093, 4217, 4651, 5023, 5147, 5209, 5333, 5519, 5581, 5953, 6263, 6449, 6883, 7069, 7193, 7937, 8123, 8681, 8867, 8929, 9239, 9859, 10169, 10789, 11161, 11471, 11657, 11719, 12277, 12401, 12959, 13331, 14323, 14447, 14633, 15377, 15439, 15749, 16183, 16369, 16493, 16741, 16927, 17299, …

and these are just primes congruent to 1 mod 31 (OEIS).

Is this, in fact, true: the squaring map has a 5-cycle in , for if and only if ?

Of course when one reflects on it there is nothing special about the number 5: we can find a d-cycle for iterated squaring (mod q), q prime, when has an element of order