Skip to main content

Power Residues and Primitive Roots

note

This is Lab 11 from Clint by Hugh Montgomery, edited by Elad Zelingher. All rights reserved to Hugh Montgomery.

The least positive integer hh such that ah1(modm)a^{h} \equiv 1(\bmod m) is called the order of a modulo mm. (This is Definition 2.6 on p. 97 of NZM.) The order of aa modulo mm exists and is finite if gcd(a,m)=1\gcd (a, m)=1; otherwise it is undefined.

Problem 1

Use PowerTab to determine the order of aa for each reduced residue class a(mod11)a(\bmod 11). What orders occur? How many times do they occur? What is the least common multiple of these orders? Repeat this with 1111 replaced by some other prime number. Formulate conjectures regarding the situation for a general prime modulus. Compare your findings with Lemma 2.35 and Theorem 2.36 of NZM.

Problem 2

Suppose that aa has order hh modulo mm. How is hh related to other numbers kk such that ak1(modm)a^{k} \equiv 1(\bmod m) ? Use PowerTab to investigate, for both prime and composite moduli, and then formulate a conjecture. Compare your conjecture with Lemma 2.31 of NZM. Euler's congruence asserts that aϕ(m)1(modm)a^{\phi(m)} \equiv 1 (\bmod m) if gcd(a,m)=1\gcd(a, m)=1. What does this imply concerning the relation between the order of aa and ϕ(m)\phi(m) ? (See Corollary 2.32 of NZM.)

Problem 3

Suppose that aa has order hh modulo mm. What is the order of aka^{k} modulo mm ? Experiment with several configurations, and formulate a conjecture. Compare with Lemma 2.33 of NZM.

Problem 4

Suppose that aa has order hh modulo mm, and that bb has order kk modulo mm. How large can the order of aba b be? How small? Use pairs taken from your work on Problem 1 above. If gcd(h,k)=1\gcd (h, k)=1, what is the order of aba b modulo mm? Study some cases, and formulate a conjecture. Compare your findings with Lemma 2.34 of NZM.

Problem 5

Suppose that aa has order hh modulo mm, that aa has order kk modulo nn, and that gcd(m,n)=1\gcd (m, n)=1. What is the order of aa modulo mnm n ? Try a=2,m=7,n=11a=2, m=7, n=11. Try a=2a=2, m=5,n=17m=5, n=17. Try a=17,m=7,n=11a=17, m=7, n=11. Formulate a conjecture (after considering additional examples, if necessary).

Problem 6

Use PowerTab to determine the order of 7(mod101)7(\bmod 101), and of 29(mod101)29(\bmod 101), and use WolframAlpha to determine the value of 729(mod101)7 \cdot 29(\bmod 101). Repeat this with 1775(mod91)17 \cdot 75(\bmod 91), and with 233313(mod424)233 \cdot 313(\bmod 424). Suppose that aa1(modm)a \cdot a' \equiv 1(\bmod m). Do you suspect a connection between the order of a(modm)a(\bmod m), and of a(modm)a' (\bmod m) ? Can you prove your conjecture? (This is found as Problem 14 at the end of §2.8\S 2.8 of NZM.)

Problem 7

The order of aa modulo mm can be determined by calculating a,a2,a, a^{2}, \ldots until the least hh is found such that ah1(modm)a^{h} \equiv 1 (\bmod m). However, since this hh may well be of size comparable to mm, it is usually much faster to use the fact that hϕ(m)h \mid \phi(m). After factoring ϕ(m)\phi(m), we search for a minimal divisor hh of ϕ(m)\phi(m) with the property that ah1(modm)a^{h} \equiv 1(\bmod m). Note that if ad1(modm)a^{d} \equiv 1 (\bmod m), and if qq is a prime divisor of dd, then either ad/q1(modm)a^{d / q} \equiv 1 (\bmod m), in which case we replace dd by d/qd / q, or else ad/q≢1(modm)a^{d / q} \not \equiv 1(\bmod m), in which case the power of qq dividing dd is the same as the power of qq dividing the order of aa. This technique is discussed on p. 100 of NZM.

To see how the order of 2 modulo 101 would be determined, Use OrderDem. To obtain the result without witnessing the calculation, use Order. Since the first step is to factor mm in order to calculate ϕ(m)\phi(m), some time may be saved by providing the value of ϕ(m)\phi(m), if this is known. For computing the order of 2 modulo 101, you can provide 100 as the third parameter (which is optional). The economy here can be quite noticeable: if the modulus is a 17 -digit prime pp, then it will be much faster to tell the machine that ϕ(p)=p1\phi(p)=p-1, rather than let the machine try to factor pp by trial division. When the values a,m,ca, m, c are given to the program Order, it is not necessary that cc actually be the value of ϕ(m)\phi(m). All that is required is that ac1a^{c} \equiv 1 (modm)(\bmod m). What happens if cc does not meet this condition? Try using Order with input 2 101 and 35.

Problem 8

The program PrimRoot finds the least positive primitive root of a prime number pp, by calculating the order of aa for a=2,3,a=2,3, \ldots until an aa is found of order p1p-1. Usually this does not take very many trials. Find the least positive primitive root of several primes in this way. For example, use PrimRoot with input 1093. If you wish to find the least primitive root larger than a certain number aa, enter it as the input aa. By using the program PrimRoot repeatedly, find all the primitive roots of the prime p=101p=101. How many primitive roots do you find? (Recall Theorem 2.36 of NZM.) What is the biggest gap found between consecutive primitive roots?

Problem 9

The program PrimRoot is not equipped to find primitive roots modulo pkp^{k} when k>1k>1, but the program Order is useful in this connection. Suppose that gg is a primitive root modulo pp. Then gg is a primitive root modulo p2p^{2} if and only if the order of gg modulo p2p^{2} is p(p1)p(p-1). The only other possibility is that the order of gg modulo p2p^{2} is p1p-1, in which case g+pg+p is a primitive root modulo p2p^{2}. (See the proof of Theorem 2.39 of NZM.) Is 22 a primitive root modulo 1012101^{2} ? Show that 1414 is a primitive root of 2929 . Is it a primitive root of 29229^{2} ? Find the least positive primitive root gg of the prime 4048740487. Show that gg is not a primitive root modulo 40487240487^{2}. (This is the least prime pp whose least positive primitive root fails to be a primitive root modulo p2p^{2}.)

Problem 10

To determine the order of a residue class aa modulo mm, we need first a number cc such that ac1(modm)a^{c} \equiv 1 (\bmod m). We could take c=ϕ(m)c=\phi(m), but usually a smaller number will do. Let λ(m)\lambda(m) denote the least positive integer cc such that ac1(modm)a^{c} \equiv 1(\bmod m) for all reduced residue classes aa. This is the Carmichael λ\lambda-function. Its values are determined by the following relations. λ(1)=λ(2)=1.λ(4)=2\lambda(1)=\lambda(2)=1 . \lambda(4)=2. If k2k \geq 2 then λ(2k)=2k2\lambda\left(2^{k}\right)=2^{k-2}. If pp is an odd prime then λ(pk)=pk1(p1)\lambda\left(p^{k}\right)=p^{k-1}(p-1). If gcd(m1,m2)=1\gcd \left(m_{1}, m_{2}\right)=1, then λ(m1m2)=lcm(λ(m1),λ(m2))\lambda\left(m_{1} m_{2}\right)=\mathrm{lcm}\left(\lambda\left(m_{1}\right), \lambda\left(m_{2}\right)\right).

Use the program Car to determine the value of λ(100)\lambda(100). Find a reduced residue class modulo 100 that has this maximal order.

Problem 11

For the programmer. Write a program that counts the number N(x)N(x) of those primes pp not exceeding xx for which 2 is a primitive root of pp. Would you conjecture that there are infinitely many such primes? Does it seem that this set of primes has positive asymptotic density among the set of all primes? That is, do you guess that N(x)cπ(x)N(x) \sim c \pi(x) as xx \rightarrow \infty for some positive constant cc ? Gauss conjectured that there exist infinitely many such primes, and E. Artin suggested a particular asymptotic density. However, D. H. Lehmer, A note on primitive roots, Scripta Math. 26 (1963), 117-119 found that numerical evidence does not fit with Artin's conjecture. This led Artin to the realization that one aspect of the situation had been overlooked (see pp. viii, ix of Artin's Collected Works). A modified form of Artin's conjecture is now widely accepted as very likely to be true, especially since C. Hooley, On Artin's conjecture, J. Reine Angew. Math. 225 1967, 209-210, showed that the modified conjecture is a consequence of the Generalized Riemann Hypothesis. The conjectured constant is

c=p(11p(p1))c=\prod_{p}\left(1-\frac{1}{p(p-1)}\right)

where the product is taken over all primes. The number 2 can be replaced by any integer aa, and the general conjecture is that there is a positive constant cac_{a} such that Na(x)caπ(x)N_{a}(x) \sim c_{a} \pi(x) as xx \rightarrow \infty, provided that a1,a0a \neq-1, a \neq 0, and that aa is not a perfect square.