In general, if is an odd prime and is a positive integer with order modulo , then will have period of length in base . This follows simply from observing that if then

.

Now let be a primitive root modulo . We shall work in base . Then will have period of length . Since the periods of are , all of length , which are all powers of some permutation of the digits of , and no two of which are congruent modulo , it follows that the digits of are all distinct. So we’ve shown the following.

Theorem. If is an odd prime and is a primitive root modulo , then the base expansion of has period of length with distinct digits.

Taking , gives our previous example. So the prime in base is indeed very special, since it is the only prime less than for which is a primitive root.