Generators: The General Case
We now consider the problem of finding generators for for any . Previously, we only studied generators for prime . To generalize, we follow the most obvious strategy: first consider prime powers, then use the Chinese Remainder Theorem to generalize.
Powers of Two
First we see that is a generator for and is a generator for . A quick check reveals has no generator: the square of any odd number is 1 modulo 8.
Next suppose has a generator for some . Then for each , we have for some . This equation still holds modulo 8 since . But this is a contradiction since it would imply is a generator of .
Thus if is a power of 2, has a generator if and only if or .
We can examine the behaviour of units under exponentiation modulo a power of two more closely. By induction we can show that
(first explicitly compute for before proving the inductive step).
From here we can show easily that if then the order of is modulo , otherwise the order is strictly smaller.
Squares of Odd Primes
Let be an odd prime. Let be a generator of . We try to find a generator of .
Intuitively, such a generator ought to somehow depend on the generator for . So we consider the problem of finding the order of in for any .
Let be the order of in . Then we also have , thus . Since , there are two possibilities. Either or . In the latter case, generates .
But the former case, occurs if and only if
Considering the binomial expansion,
Note is not invertible, so we go back to first principles and find
(the division is an integer division). In other words, is a generator of except for one value of . Thus each of the generators of can be used to construct generators of .
Alternative proof: we show that at least one of or is a generator:
Consider the binomial expansion gives
Since this is nonzero, we see that and cannot both be roots of the polynomial , hence (at least) one of them has order .
Powers of Odd Primes
Let be a generator of . By considering the binomial expansion and inducting on , we find that if
then
Then the order of in must be , hence generates .
The General Case
We first consider odd . Write . By the Chinese Remainder Theorem we have
Each corresponds to some element of the right-hand side. Now each satisfies
so if we take the lowest common multiple of the orders
we find , thus has order dividing . On the other hand, if we choose each to be a generator of then has order .
Hence a generator exists in if and only if . Now is even thus for implies at most one of the is odd hence is in fact a prime power.
Now suppose where is odd. Again by the Chinese Remainder Theorem we have . If then has no generator since doesn’t. If , since has order 2, the lowest common multiple of and is less than , thus no generator exists. Lastly if then if is a generator for then thus a generator exists [ is a generator].
In summary, has a generator precisely when for odd primes and positive integers .
Note we can tighten Euler’s Theorem in this sense: in general we can find some such that for all , and furthermore there exists with order .
From the above, we see if for odd primes , then we can take
for and
for .