# On Pythagorean Triples and the Primitive Roots Modulo a Prime

Authors: Jingzhe Wang
Journal: Journal of Mathematics
 (2021)

---

## Abstract

In this paper, we use the elementary methods and the estimates for character sums to study a problem related to primitive roots and the Pythagorean triples and prove the following result: letp be an odd prime large enough. Then, there must exist three primitive roots x,y, and z modulo p such that x2+y2=z2.


---

## Body

## 1. Introduction

It is well known that all positive integer solutions of the equationx2+y2=z2 are x=ta2−b2, y=2tab, and z=ta2+b2, where t, a, and b are arbitrary positive integers satisfying a>b; a and b have no prime divisors in common, and one of a or b is odd and the other is even. This result can be found in many elementary number theory textbooks, e.g., reference [1] (see Theorems 2–9). We call such a set of solution x,y,z as a Pythagorean triple. For example, taking t=b=1 and a=2 or 4, then x,y,x=3,4,5,15,8,17 are two Pythagorean triples.In this paper, we only focus on the solutions of the form(1)x,y,z=4a2−2b−12,4a2b−1,4a2+2b−12,where a and b are any positive integers.On the other hand, letp be a fixed odd prime and g be an integer with g,p=1. If g,g2,…,gp−1 form a reduced residue system modulo p, then g is called a primitive root modulo p. For other properties of the primitive roots and related results, see references [1–11], which we will not cover here. In this paper, we will consider the following problem.For any odd primep and integer 1<M<p, whether there is a Pythagorean triple x,y,z in (1) with 1≤a,b≤M, such that x,y, and z all are the primitive roots modulo p?If there are, letCM,p denotes the number of all such Pythagorean triples x,y,z in (1) with 1≤a,b≤M. Then, how does CM,p depend on p?We think these problems are interesting, and they depict the distribution properties of the Pythagorean triples in other special integer sets, such as the primitive roots modulop, D. H. Lehmer numbers, and Lucas and Fibonacci sequences.In this paper, let us make two simple conclusions about the asymptotic properties ofCM,p as follows.Theorem 1.
For any odd primep, we have the asymptotic formula(2)Cp,p=ϕ3p−1p−1+Oϕ3p−1p3/2⋅8ωp−1,where, as usual, ϕn denotes the Euler function and ωn denotes the number of all distinct prime divisors of n.Theorem 2.
Letp be an odd prime with p≡1mod4. Then, for any integer 1<M≤p, we have the asymptotic formula(3)CM,p=ϕ3p−1p−13⋅M2+OM2⋅ϕ3p−1p7/2⋅8ωp−1⋅ln2p+Oϕ3p−1p2⋅8ωp−1⋅ln2p.It is clear that for any positive numberε>0, if M>p1/2+ε, then Theorem 2 is nontrivial. That is, the main term is larger than the error terms.From our theorems, we may immediately deduce the following two corollaries.Corollary 1.
Letp be an odd prime large enough. Then, there must exist three primitive roots x,y, and z modulo p such that(4)x2+y2=z2.Corollary 2.
Letp≡1mod4 be a prime large enough. Then, for any integer p1/2+ε<M<p, there must exist three primitive roots x,y, and z modulo p with 1≤x,y,z≤M2 such that(5)x2+y2=z2,where ε>0 is any fixed positive number.


## 2. Several Lemmas

To complete the proof of our main result, we need the following four simple lemmas. For the sake of simplicity, we do not repeat some elementary number theory and analytic number theory results, which can be found in references [10, 12, 13]. First, we have the following.Lemma 1.
Letp be an odd prime. Then, for any integer a with a,p=1, we have the identity(6)ϕp−1p−1∑k|p−1μkϕk∑r=1k′er⋅indak=1,ifais a primitive root modp,0,ifais not a primitive root modp,where ey=e2πiy, ∑r=1k′ denotes the summation over all integers 1≤r≤k such that r is coprime to k, μn is the Möbius function, and inda denotes the index of a relative to some fixed primitive root gmodp.Proof.
See Proposition 2.2 in [13].Lemma 2.
Letp be an odd prime and χ1,…,χr be Dirichlet characters modulo p, at least one of which is nonprincipal character. Let fx be an integral coefficient polynomial of degree d. Then, for pairwise distinct integers a1,…,ar, we have the estimate(7)∑a=1p−1χ1a+a1χ2a+a2…χra+arefap≤r+d⋅p1/2.Proof.
This is Lemma 17 in [14]. Some related work can also be found in [15].Lemma 3.
Letp be an odd prime. Then, for any characters χ1, χ2, and χ3 (not all the principal characters) modulo p, we have the estimate(8)∑a=1p−1χ14a2−1χ24aχ34a2+1=Op1/2.Proof.
Ifχ2 is an odd character modulo p, then χ2−1=−1, so we have(9)∑a=1p−1χ14a2−1χ24aχ34a2+1=∑a=1p−1χ14−a2−1χ2−4aχ34−a2+1=−∑a=1p−1χ14a2−1χ24aχ34a2+1,which implies(10)∑a=1p−1χ14a2−1χ24aχ34a2+1=0.
Ifχ2 is an even character modulo p, then there is a character ψ modulo p such that χ2=ψ2. Now, from the properties of the Legendre symbol modulo p and Lemma 2, we have the estimate(11)∑a=1p−1χ14a2−1χ24aχ34a2+1=χ24∑a=1p−1χ14a2−1ψ2aχ34a2+1=χ24∑a=1p−11+apχ14a−1ψaχ34a+1=χ24∑a=1p−1apχ14a−1ψaχ34a+1+χ24∑a=1p−1χ14a−1ψaχ34a+1=Op1/2.
Ifχ1 and χ3 are the principal character modulo p, then χ2 is not the principal character modulo p. In this case, we have(12)∑a=1p−1χ14a2−1χ24aχ34a2+1=∑a=1p−1χ24a+O1=O1.
Combining (10)–(12), we may immediately deduce Lemma 3.Lemma 4.
Letp be an odd prime with p≡1mod4 and 1<M<p be an integer. Then, for any characters χ1, χ2, and χ3 (not all the principal characters) modulo p, we have the estimate(13)∑a=1M∑b=1Mχ14a2−2b−12χ24a2b−1χ34a2+2b−12=OM2p⋅ln2p+Op⋅lnp.Proof.
For any integern, from the trigonometric identity(14)∑a=0p−1enap=p,ifp|n,0,ifp∤n,we have(15)∑a=1M∑b=1Mχ14a2−2b−12χ24a2b−1χ34a2+2b−12=1p2∑a=1p−1∑b=1p−1∑c=1M∑d=1M∑r=0p−1∑s=0p−1era−cpesb−dp×χ14a2−2b−12χ24a2b−1χ34a2+2b−12=M2p2∑a=1p−1∑b=1p−1χ14a2−2b−12χ24a2b−1χ34a2+2b−12+Mp2∑r=1p−1∑c=1M∑a=1p−1∑b=1p−1χ14a2−2b−12×χ24a2b−1χ34a2+2b−12era−cp+Mp2∑s=1p−1∑d=1M∑a=1p−1∑b=1p−1χ14a2−2b−12×χ24a2b−1χ34a2+2b−12esb−dp+1p2∑r=1p−1∑s=1p−1∑a=1p−1∑b=1p−1∑c=1M∑d=1Mera−cpesb−dp×χ14a2−2b−12χ24a2b−1χ34a2+2b−12≡W1+W2+W3+W4.
From the properties of the reduced residue system, complete residue system modulop, and Lemma 3, we have(16)W1=M2p2∑a=1p−1∑b=1p−1χ14a2−2b−12χ24a2b−1χ34a2+2b−12=M2p2∑a=1p−1∑b=0p−1χ14a2−2b−12χ24a2b−1χ34a2+2b−12−M2p2∑a=1p−1χ14a2−1χ2−4aχ34a2+1=M2p2∑a=1p−1∑b=1p−1χ14a2−b2χ24abχ34a2+b2+Op1/2=M2p2∑a=1p−1χ14a2−1χ24aχ34a2+1∑b=1p−1χ1b2χ2b2χ3b2+Op1/2=OM2p⋅∑a=1p−1χ14a2−1χ24aχ34a2+1+Op1/2=OM2p+Op1/2.
Note that ifp≡1mod4, then there exist two integers u0 and −u0 such that the congruence 4x2≡−1modp. So we have(17)4a2+1≡4a2−4u02≡4a−u0a+u0modp.
From the estimate(18)∑c=1Me−rcp=O1sinπr/p,the method of proving (16), and the properties of Gauss sums, we have(19)W2=Mp2∑r=1p−1∑c=1M∑a=1p−1∑b=1p−1χ14a2−2b−12×χ24a2b−1χ34a2+2b−12era−cp=Mp2∑r=1p−1∑c=1M∑a=1p−1∑b=1p−1χ14a2−b2×χ24abχ34a2+b2era−cp−Mp2∑r=1p−1∑c=1M∑a=1p−1χ14a2−1χ2−4aχ34a2+1era−cp=Mp2∑r=1p−1∑a=1p−1χ14a2−1χ24aχ34a2+1×∑b=1p−1χ1b2χ2b2χ3b2erabp∑c=1Me−rcp−Mp2∑r=1p−1∑c=1M∑a=1p−1χ14a2−1χ2−4aχ34a2+1era−cp≪Mτχ12χ22χ32p2∑r=1p−1∑a=1p−1χ14a2−1χ24aχ34a2+1χ1¯2aχ2¯2aχ3¯2a×1sinπr/p+Mp2⋅p1/2⋅∑r=1p−11sinπr/p≪M⋅lnpp⋅∑a=1p−1χ14a2−1χ1¯χ2¯2χ3¯24aχ34a2+1+Mp⋅lnp≪M⋅lnp,where τχ=∑a=1p−1χaea/p denotes the classical Gauss sums and τχ≤p.
Similarly, we also have(20)W3=Mp2∑s=1p−1∑d=1M∑a=1p−1∑b=1p−1χ14a2−2b−12×χ24a2b−1χ34a2+2b−12esb−dp=Mp2∑s=1p−1∑d=1M∑a=1p−1χ14a2−1χ24aχ34a2+1e−sdp×∑b=1p−1χ122b−1χ222b−1χ322b−1e2¯s2b−1+1p≪Mp3/2∑s=1p−11sinπs/p⋅∑b=1p−1χ12bχ22bχ32be2¯sbp≪M⋅lnp,and(21)W4=1p2∑r=1p−1∑s=1p−1∑a=1p−1∑b=0p−1∑c=1M∑d=1Mera−cpesb−dp×χ14a2−2b−12χ24a2b−1χ34a2+2b−12−1p2∑r=1p−1∑s=1p−1∑a=1p−1∑c=1M∑d=1Mera−cpe−sdp×χ14a2−1χ2−4aχ34a2+1=1p2∑r=1p−1∑s=1p−1∑a=1p−1∑b=1p−1∑c=1M∑d=1Mera−cpe2¯sb+1−2dp×χ14a2−b2χ24abχ34a2+b2+Op1/2⋅ln2p=1p2∑r=1p−1∑s=1p−1∑a=1p−1∑b=1p−1∑c=1M∑d=1Merab−cpe2¯sb+1−2dp×χ14a2−1χ24aχ34a2+1χ12bχ22bχ32b+Op1/2⋅ln2p=τχ12χ22χ32p2∑r=1p−1∑s=1p−1∑a=1p−1∑c=1M∑d=1Me−rcpe2¯s1−2dp×χ14a2−1χ24aχ34a2+1χ¯12ra+2¯sχ¯22ra+2¯s×χ¯32ra+2¯s+Op1/2⋅ln2p=Opp2∑r=1p−1∑s=1p−11sinπr/p⋅1sinπs/p=Op⋅ln2p,where a¯ denotes the solution of the congruence equation ax≡1modp.
Combining (15), (16), and (19)–(21), we have the estimate(22)∑a=1M∑b=1Mχ14a2−2b−12χ24a2b−1χ34a2+2b−12=OM2p⋅ln2p+Op⋅ln2p.
This proves Lemma4.


## 3. Proofs of the Theorems

In this section, we shall complete the proofs of our main results. First, we prove Theorem1. From the definition of Cp,p, Lemma 1, and the properties of the complete residue system modulo p, we have the identity(23)Cp,p=ϕ3p−1p−13∑a=1p−1∑b=1p−1∑h∣p−1μhϕh∑r=1h′er⋅ind4a2−2b−12h×∑k∣p−1μkϕk∑t=1k′et⋅ind4a2b−1k×∑s∣p−1μsϕs∑u=1s′eu⋅ind4a2+2b−12s=ϕ3p−1p−13∑h|p−1μhϕh∑k|p−1μkϕk∑s|p−1μsϕs∑r=1h′∑t=1k′∑u=1s′×∑a=1p−1∑b=1p−1χr,h4a2−2b−12χt,k4a2b−1χu,s4a2+2b−12=ϕ3p−1p−13∑h|p−1μhϕh∑k|p−1μkϕk∑s|p−1μsϕs∑r=1h′∑t=1k′∑u=1s′×∑a=1p−1∑b=0p−1χr,h4a2−2b−12χt,k4a2b−1χu,s4a2+2b−12−ϕ3p−1p−13∑h|p−1μhϕh∑k|p−1μkϕk∑s|p−1μsϕs∑r=1h′∑t=1k′∑u=1s′×∑a=1p−1χr,h4a2−1χt,k−4aχu,s4a2+1=ϕ3p−1p−13∑h|p−1μhϕh∑k|p−1μkϕk∑s|p−1μsϕs∑r=1h′∑t=1k′∑u=1s′×∑a=1p−1∑b=1p−1χr,h4a2−b2χt,k4abχu,s4a2+b2−ϕ3p−1p−13∑h|p−1μhϕh∑k|p−1μkϕk∑s|p−1μsϕs∑r=1h′∑t=1k′∑u=1s′×∑a=1p−1χr,h4a2−1χt,k−4aχu,s4a2+1,where χt,ka=et⋅inda/k denotes a Dirichlet character modulo p.Ifχr,h=χt,k=χu,s=χ0 is the principal character modulo p, then we have(24)∑a=1p−1∑b=1p−1χ04a2−b2χ04abχ04a2+b2=p−12+Op.If one ofχr,h, χt,k, or χu,s is a nonprincipal character modulo p, then from Lemma 3 and the properties of the reduced residue system modulo p, we have(25)∑a=1p−1∑b=1p−1χr,h4a2−b2χt,k4abχu,s4a2+b2=∑a=1p−1∑b=1p−1χr,h4ab2−b2χt,k4abbχu,s4ab2+b2=∑a=1p−1χr,h4a2−1χt,k4aχu,s4a2+1∑b=1p−1χr,h2bχt,k2bχu,s2b=Op⋅∑a=1p−1χr,h4a2−1χt,k4aχu,s4a2+1=Op3/2.Note that the estimate(26)∑k|p−1μkϕk∑t=1k′1=∑k|p−1μk=2ωp−1,where ωn denotes the number of all distinct prime divisors of n.From (24) and (25), we have(27)ϕ3p−1p−13∑h|p−1μhϕh∑k|p−1μkϕk∑s|p−1μsϕs∑r=1h′∑t=1k′∑u=1s′×∑a=1p−1∑b=1p−1χr,h4a2−b2χt,k4abχu,s4a2+b2=ϕ3p−1p−1+Oϕ3p−1p−13⋅p3/2⋅∑k|p−1μkϕk∑t=1k′13=ϕ3p−1p−1+Oϕ3p−1p−13⋅p3/2⋅8ωp−1.(28)ϕ3p−1p−13∑h|p−1μhϕh∑k|p−1μkϕk∑s|p−1μsϕs∑r=1h′∑t=1k′∑u=1s′×∑a=1p−1χr,h4a2−1χt,k−4aχu,s4a2+1=Oϕ3p−1p−13⋅p⋅8ωp−1.Combining (23), (27), and (28), we have the asymptotic formula(29)Cp,p=ϕ3p−1p−1+Oϕ3p−1p3/2⋅8ωp−1.This proves Theorem1.Similarly, from Lemma4 and the method of proving Theorem 1, we can also deduce Theorem 2. Details are not given in this study.


## 4. Conclusion

The main results of this paper are two theorems, which are closely related to Pythagorean triples and primitive roots modulo an odd primep. It describes that when the prime p is large enough, then there must exist three primitive roots x,y, and z modulo p such that x2+y2=z2. At the same time, we also give a sharp asymptotic formula for the counting function of all such solutions x,y,z. Of course, our conclusion can also be generalized to other special integer sets, such as D. H. Lehmer numbers and k-th residue modulo p.



---

*Source: 7634728-2021-07-30.xml*