iconOpen Access



On the Mean Value of High-Powers of a Special Character Sum Modulo a Prime

Xiaodan Yuan*, Wenpeng Zhang

School of Mathematics, Northwest University, Xi’an, China

* Corresponding Author: Xiaodan Yuan. Email: email

(This article belongs to the Special Issue: Application of Computer Tools in the Study of Mathematical Problems)

Computer Modeling in Engineering & Sciences 2023, 136(1), 943-953. https://doi.org/10.32604/cmes.2023.024363


In this paper, we use the elementary methods, the properties of Dirichlet character sums and the classical Gauss sums to study the estimation of the mean value of high-powers for a special character sum modulo a prime, and derive an exact computational formula. It can be conveniently programmed by the “Mathematica” software, by which we can get the exact results easily.


1  Introduction

Let p be an odd prime, the quadratic character modulo p is called the Legendre symbol, which is defined by


Many mathematicians have studied the properties of the Legendre symbol and obtained a series of important results (see [113]). Perhaps the most representative properties of the Legendre’s symbol are as follows:

Let p and q be two distinct odd primes, then one has the quadratic reciprocal formula (see [14]: Theorem 9.8 or [15]: Theorems 4–6)


For any odd prime p with p1 mod 4, there exists two non-zero integers αp and βp such that (see [15]: Theorems 4–11)


In fact, the integers αp and βp in Eq. (1) can be represented by the Jacobsthal sums ϕ2(r), which is (see [16]: Definition of the Jacobsthal sums)


where s is any quadratic non-residue modulo p.

Now we consider a sum A(r) be similar to βp. For any integers r with (r,p)=1 and k0, let A(r) and Sk(p) be defined as follows:


In this paper, we give an exact computational formula for Sk(p) with p1 mod 6, and prove the following result:

Theorem. Let p be a prime with p1 mod 6, for any integer k, we have the identity


where d and b are uniquely determined by 4p=d2+27b2, d1 mod 3 and b>0.

From this Theorem, we can immediately deduce the following four Corollaries:

Corollary 1. Let p be a prime with p1 mod 6, then we have


Corollary 2. Let p be a prime with p1 mod 6, we have


Corollary 3. Let p be a prime with p1 mod 6, then we have


Corollary 4. Let p be a prime with p1 mod 6, we have


Some notes: In our Theorem, we only discuss the case p1 mod 6. If p5 mod 6, the result is trivial, see Proposition 6.1.2 in [16]. In this case, for any integer r with (r,p)=1, we have the identity


Thus, for all prime p with p5 mod 6 and k1, we have Sk(p)=0.

In addition, our Theorem holds for all negative integers.

Obviously, the advantage of our work is that it can transfer a complex mathematical computational problem into a simple form suitable for computer programming. It means that for any fixed prime p with p1 mod 6 and integer k, the exact value of Sk(p) can be calculated by our Theorem and a simple computer program. In Section 4, we give an example to calculate the exact results of the prime number p within 200 satisfying conditions p1 mod 6 and d1 mod 3. The exact results of calculation are summarised in Table 1.


2  Several Lemmas

In this section, we give some simple Lemmas, which are necessary in the proofs of our Theorem. In addition, we need some properties of the classical Gauss sums and character sums, which can be found in many number theory books, such as [14,15] or [17], and we will not repeat them. First, we have the following:

Lemma 1. Let p be a prime with p1 mod 3, for any third-order character λ modulo p, we have the identity


where τ(χ)=a=1p1χ(a)e(ap) denotes the classical Gauss sums with e(y)=e2πiy and i2=1, d is the same as the one in the Theorem.

Proof. See references [18] or [19].

Lemma 2. Let p be an odd prime, for any non-principal character χ modulo p, we have the identity


where χ2=(p) denotes the Legendre’s symbol modulo p.

Proof. From the properties of the classical Gauss sums we have


On the other hand, for any integer b with (b,p)=1, from the identity


we also have


From Eqs. (2) and (3) we have the identity




This proves Lemma 2.

Lemma 3. Let p be a prime p with p1 mod 6, then for any integer r with (r,p)=1 and three order character λ modulo p, we have the identity


Proof. From the characteristic function of the cubic residue modulo p, we have


Applying Eq. (4) we have


From the properties of the classical Gauss sums, we have


Taking χ=λ in Lemma 2, we have


Note that τ(λ)τ(λ¯)=p, from Eqs. (6) and (7) we have


Similarly, we also have


Combining Eqs. (5), (8) and (9) we can deduce that


This proves Lemma 3.

Lemma 4. Let p be any odd prime with p1 mod 6, then for any integers k3 and r with (r,p)=1, we have the third order recursive formula


where d is the same as defined in the Theorem.

Proof. Note that λ3=λ¯3=χ0, the principal character modulo p, from Lemma 1 and Lemma 3 we have


Indeed, for any integer k3, from Eq. (10) we have the third order recursive formula


This proves Lemma 4.

Lemma 5. Let p be any odd prime with p1 mod 6, then we have


Sk(p)=3pSk2(p)+(d33pd)Sk3(p)for allk4.

Proof. From the definition


and the orthogonality of characters modulo p, we have



From Eq. (10) we also have


If k4, then from Lemma 4 we have


Now Lemma 5 follows from Eqs. (11)(14).

3  Proof of the Theorem

In this section, we complete the proof of our Theorem. It is clear that the characteristic equation of the third order linear recursive formula




Note that 4p=d2+27b2, from Eq. (16) we have


It is clear that the three roots of Eq. (16) are x1=d, x2=d+9d2 and x3=d9d2. Indeed, the general term of Eq. (15) is


From Lemma 5 we have


Solving the Eq. (18) we can get C1=C2=C3=13. From Eq. (17) we have


This proves our Theorem.

Obviously, using Lemma 4 we can also extend k in Lemma 5 to all negative integers, which leads to the Corollary 1 and the Corollary 2.

This completes the proofs of our all results.

4  Conclusion

In this paper, we give an exact computational formula for Sk(p) with p1 mod 6, which is, for any integer k, we have the identity


where d and b are uniquely determined by 4p=d2+27b2, p1 mod 6 and b>0.

Meanwhile, the problems of calculating the mean value of high-powers of quadratic character sums modulo a prime are given.

In the end, we use the mathematical software “Mathematica” to program and calculate the exact values of S1(p) to S8(p) of the prime number p within 200 satisfying conditions p1 mod 6 and d1 mod 3, as shown in Table 1. Its application can also extend to Sk(p) that satisfies conditions p1 mod 6 and d1 mod 3 (where 4p=d2+27b2) for any k. See the Appendix A for this specific computer program.

Acknowledgement: The authors would like to thank the editor and referees for their suggestions and critical comments that substantially improve the presentation of this work.

Funding Statement: This work was supported by the N. S. F. (12126357) of China.

Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.


 1.  Ankeny, N. C. (1952). The least quadratic non-residue. Annals of Mathematics, 55, 65–72. DOI 10.2307/1969420. [Google Scholar] [CrossRef]

 2.  Peralta, R. (1992). On the distribution of quadratic residues and non-residues modulo a prime number. Mathematics of Computation, 58, 433–440. DOI 10.1090/S0025-5718-1992-1106978-9. [Google Scholar] [CrossRef]

 3.  Sun, Z. H. (2002). Consecutive numbers with the same legendre symbol. Proceedings of the American Mathematical Society, 130, 2503–2507. DOI 10.1090/S0002-9939-02-06600-5. [Google Scholar] [CrossRef]

 4.  Hummel, P. (2003). On consecutive quadratic non-residues: A conjecture of Issai Schur. Journal of Number Theory, 103(2), 257–266. DOI 10.1016/j.jnt.2003.06.003. [Google Scholar] [CrossRef]

 5.  Garaev, M. Z. (2003). A note on the least quadratic non-residue of the integer-sequences. Bulletin of the Australian Mathematical Society, 68(1), 1–11. DOI 10.1017/S0004972700037369. [Google Scholar] [CrossRef]

 6.  Kohnen, W. (2008). An elementary proof in the theory of quadratic residues. Bulletin of the Korean Mathematical Society, 45(2), 273–275. DOI 10.4134/BKMS.2008.45.2.273. [Google Scholar] [CrossRef]

 7.  Yuk-Kam, L., Jie, W. (2008). On the least quadratic non-residue. International Journal of Number Theory, 4, 423–435. DOI 10.1142/S1793042108001432. [Google Scholar] [CrossRef]

 8.  Schinzel, A. (2011). Primitive roots and quadratic non-residues. Acta Arithmetica, 149, 161–170. DOI 10.4064/aa149-2-5. [Google Scholar] [CrossRef]

 9.  Wright, S. (2013). Quadratic residues and non-residues in arithmetic progression. Journal of Number Theory, 133(7), 2398–2430. DOI 10.1016/j.jnt.2013.01.004. [Google Scholar] [CrossRef]

10. Dummit, D. S., Dummit, E. P., Kisilevsky, H. (2016). Characterizations of quadratic, cubic, and quartic residue matrices. Journal of Number Theory, 168, 167–179. DOI 10.1016/j.jnt.2016.04.014. [Google Scholar] [CrossRef]

11. Ţiplea, F. L., Iftene, S., Teşeleanu, G., Nica, A. M. (2020). On the distribution of quadratic residues and non-quadratic residues modulo composite integers and applications to cryptography. Applied Mathematics and Computation, 372, 124993. [Google Scholar]

12. Wang, T. T., Lv, X. X. (2020). The quadratic residues and some of their new distribution properties. Symmetry, 12(3), 421. [Google Scholar]

13. Zhang, J. F., Meng, Y. Y. (2021). The mean values of character sums and their applications. Mathematics, 9(4), 318. [Google Scholar]

14. Apostol, T. M. (1976). Introduction to analytic number theory. New York: Springer-Verlag. [Google Scholar]

15. Zhang, W. P., Li, H. L. (2013). Elementary number theory. Xi’an, China: Shaanxi Normal University Press. [Google Scholar]

16. Berndt, B. C., Evans, R. J., Williams, K. S. (1999). Gauss and jacobi sums. The Mathematical Gazette, 83(497), 349–351. [Google Scholar]

17. Narkiewicz, W. (1986). Classical problems in number theory. Warszawa: Polish Scientifc Publishers. [Google Scholar]

18. Zhang, W. P., Hu, J. Y. (2018). The number of solutions of the diagonal cubic congruence equation modp. Mathematical Reports, 20(1), 73–80. [Google Scholar]

19. Berndt, B. C., Evans, R. J. (1981). The determination of gauss sums. Bulletin of the American Mathematical Society, 5(2), 107–128. [Google Scholar]

Appendix A.






Array[p, 20];






, ]



Array[d, 20];






, ]


S[pi, di, bi, ki]: = (1/3) ∗ (diki + ((−di + 9 ∗ bi)/2)ki + ((−di −9 ∗ bi)/2)ki)




If[Element[b, Integers],








Cite This Article

APA Style
Yuan, X., Zhang, W. (2023). On the mean value of high-powers of a special character sum modulo a prime. Computer Modeling in Engineering & Sciences, 136(1), 943-953. https://doi.org/10.32604/cmes.2023.024363
Vancouver Style
Yuan X, Zhang W. On the mean value of high-powers of a special character sum modulo a prime. Comput Model Eng Sci. 2023;136(1):943-953 https://doi.org/10.32604/cmes.2023.024363
IEEE Style
X. Yuan and W. Zhang, "On the Mean Value of High-Powers of a Special Character Sum Modulo a Prime," Comput. Model. Eng. Sci., vol. 136, no. 1, pp. 943-953. 2023. https://doi.org/10.32604/cmes.2023.024363

cc This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • 1109


  • 502


  • 0


Share Link