The Order of an Element
For , the order of mod is the least with . Key facts: iff ; hence . So to find the order, test only the divisors of .
The order is the period of the sequence mod : once the sequence starts over, so the powers go around a cycle of length . Fermat and Euler only say the period divides or ; the order is the exact period. This is why "find the smallest with " is not answered by Fermat alone, and why decimal expansions of have period equal to the order of mod .
The order divides , so the candidates are . Compute: , , , . None is , so the order is : the powers of visit every nonzero residue before returning to .
Again the order divides . , , . The order is : the powers of cycle through only . Fermat's is true but hides the fact that already is.
, so the order divides : test . , , . Since , the order does not divide , and . The divisors of that do not divide are just and , and , so the order is .
The decimal expansion of () has period equal to the order of modulo . For , the order of is : .
Taking as the order. Fermat gives , but the order of is , not . And testing exponents that are not divisors of wastes time: an order can only be a divisor.
Find the order of modulo , and the period of the decimal expansion of .
Show the answerHide the answer
(and ): order (a primitive root). For : , , so and no smaller divisor of works: period ().
Primitive Roots
A primitive root mod is an element of order exactly . Every prime has one, and then every nonzero residue is a power of it. If is a primitive root mod , then is also one exactly when — so there are primitive roots.
A primitive root turns multiplication into addition: writing , the exponent (the index or discrete logarithm) is defined mod , and multiplying residues adds their indices. The order of is , because exactly when . That is where the count comes from. Not every modulus has a primitive root — only and for odd primes do.
We need order . Powers of : — order , a primitive root. Powers of : — also order . The others fall short: has order (), has order , and has order . So the primitive roots are and — of them.
Solve . Since is a primitive root mod , some works; read it off the cycle . The value is the ninth: . Check: . ✓
With , the primitive roots are for coprime to : . From the cycle, , , , . So the primitive roots mod are — four of them, and .
Assuming every modulus has a primitive root. Mod the units are and , , are all : every element has order at most , though . Nothing generates the group.
Find all primitive roots modulo .
Show the answerHide the answer
Try : , , so neither nor is , and the order (a divisor of ) must be . The primitive roots are with : , , , . So — of them.
Quadratic Residues
For an odd prime , exactly half of the nonzero residues are squares (quadratic residues). Euler's criterion: is a residue iff ; a non-residue gives . In particular is a square mod iff .
Half the residues are squares because and have the same square and no others do (from , ). The criterion is Fermat cut in half: , so , and it is exactly for the squares. The statement about is what makes factor mod and never mod — and behind it sits quadratic reciprocity.
Euler's criterion: , so yes. Indeed and — two square roots, and , as the pairing predicts.
: yes. To find a root, square (the other half are their negatives): — so and also . The squares mod are : six of the twelve.
Since , should be a square, and the table shows and . Consequence: every odd prime dividing a number of the form is , since modulo that prime. For example .
Concluding has a solution because looks like a square, or has none because it does not. is a square mod every , but is a square mod and not mod (the squares mod are ). Being a residue depends on .
List the quadratic residues mod , and decide whether has a solution.
Show the answerHide the answer
Squares of : (and repeat them). Residues: . is not among them, as expected since : no solution.
Why It Works
Let be the order of and suppose . Divide: with . Then . If this contradicts the minimality of ; so and . Apply it to (Euler) and follows. The division algorithm, once more, is the whole proof.