Abstract

We consider any prime number . Let be two positive integers. We are interested in the arithmetic progressions (sequences) with the common difference and length , where the sequence entries are from the set of quadratic residue modulo or the set of quadratic nonresidue modulo . The numbers of such sequences are denoted as and , respectively. In this paper, we apply analytic number theory methods, in particular, properties of Legendre’s symbol modulo and character sums, to study the numbers and . Exact formulas are given for certain values of and under some restrictions. In addition, estimation formulas in other cases are given.

1. Introduction

Let be an odd prime. For any integer with , namely, coprime , if there exists an integer such that , then is called a quadratic residue modulo . Otherwise, is called a quadratic nonresidue modulo . We only concern those quadratic residues or nonresidues in the finite field . Thus, throughout the paper, when we talk about a sequence of quadratic residues mod , it means that the entries are the least positive quadratic residues mod . It is the same for sequences of quadratic nonresidue mod . In the study of quadratic residue modulo , Legendre first introduced the Legendre symbol, a character function whose values determine the status of an integer being a quadratic residue modulo or not. For any integer , the definition of the Legendre symbol is given as follows:

The following properties of the Legendre symbol are well known:and for any two different odd prime numbers and ,

Quadratic residues play important roles in solving many classical number theory problems. The study of quadratic residues brings not only profound theoretical significance but also a wide range of applications. This paper focuses on the distribution properties of arithmetic progression of quadratic residues and quadratic nonresidues. Many scholars have conducted in-depth research on similar problems and obtained many important results, some of which are useful for our project. For example, in 1956, Carlitz [1] estimated the number of consecutive quadratic residues or consecutive quadratic nonresidues in the finite field :

Based on the improved Vinogradov estimation, Burgess [2] proved in 1957 that, if and are arbitrarily fixed positive numbers, for sufficiently large odd prime numbers and any integer , if , then

This indicates that the maximum number of consecutive quadratic residues or consecutive quadratic nonresidue modulo of a sufficiently large prime is . This result was further improved and can be referenced in literature [36]. In 1992, Peralta [7] improved the error term in (4) and proved that

In 2020, Carella [8] used the method of exponential sums to improve the above results. Let be a sufficiently large prime number and be any positive integer satisfying , and the number satisfies:(i)(ii)

In 2020, Wang and Lv [9] studied the number of integers such that , , are all quadratic residues and quadratic non-residues modulo , where satisfying . In 2022, the first author of this paper and Li [10] studied distribution properties of triples of consecutive quadratic residues (named 3-CQR) and consecutive quadratic nonresidue (3-CQN) modulo and provided exact formulas for the numbers and of 3-CQRs and 3-CQNs. Other interesting properties of quadratic residues can be referred to [11].

We start with the following definitions.

Definition 1. Let be an odd prime number and and be two positive integers.(1)We define to be the number of arithmetic sequences of quadratic residues with the common difference and length (2)Correspondingly, denotes the number of arithmetic sequences, where the entries are all quadratic nonresidues, with the common difference and length In this paper, we use analytic methods, combined with the properties of complete residue system modulo , to study and , defined as above. We give exact formulas for and under some restrictions, when are small. Estimation formulas in other cases are given as well.
The structure of the paper is as follows. In Section 2, we give some preliminary results stated as lemmas which are useful for developing the results in the later sections. In Section 3, we give the exact formulas on and in the case for certain and . In Section 4, we discuss the upper and lower bounds of and in the case and when and . Conclusions and future directions are given in Section 5.

2. Preliminary Lemmas

In order to prove the main results, we first develop two preliminary lemmas.

Lemma 2. Let be an odd prime number, and for any integer with , then

Proof. From the properties of complete residue system modulo , we haveApplying the properties of Legendre’s symbol modulo , we have

Lemma 3. Let be an odd prime number, and for any integer with , then

Proof. From the properties of complete residue system modulo , we haveNext, we list several results from [10, 1215], which are useful the proofs of later theorems.

Lemma 4 [10]. Let be an odd prime number with . Then, the number of 3 consecutive quadratic residues is the same as the number of 3 consecutive quadratic nonresidues:

Lemma 5 [12]. Assume and , then

Lemma 6 [13, 14]. Let be a positive integer and , where are integers not pairwise congruent to each other modulo , and for every , then

Lemma 7 [15]. Let be any integers with , and we have

3. Formulas for and When and

In this section, we discuss the enumeration of the arithmetic progressions of quadratic residues (or nonresidues) of length 3 with the common distances 3 or 4. Using the properties of Legendre’s symbol modulo , the properties of the complete residue system and reduced residue system, and the preliminary lemmas from Section 2, we give the exact formulas for , , and for certain prime numbers .

Theorem 8. Let be an odd prime number with and , , and then(1)(2)

Proof. (1)From the definition of and the properties of Legendre’s symbol modulo , we haveAs passes through a reduced residue system , passes through a reduced residue system as well. By replacing by , we haveNote that if . From Lemma 4, we haveIf , . Then,Combining (19) and (20), we haveSimilarly,(2)From the definition of and the properties of Legendre’s symbol modulo , we haveWe replace by , and we haveNoting that if , then . From Lemma 4, we haveand if , then . We have , and then,Combining (25) and (26), we obtain the desired formula for . Furthermore, by similar calculations, we can show that .

4. Formulas for and When and

In this section, we focus on the cases when and . For convenience, we introduce some new notations.

Definition 9. For any integer and prime number , letwhere are integers.
Note thatNow, we give upper and lower bounds for and when and . We start with .

Theorem 10. Let be a prime with . Then,where.

Proof. (1)Note that is identical with the following sum:Let . We can writeNext, we calculate several summands of as follows:The above impliesInserting these formulas into the previous formula for , we obtainBy Lemma 7, , which gives an upper bound and a lower bound for :(2)Similarly, is identical with the following sum:Replacing by , we obtainWhen , we have , and thus,Therefore,It proves Theorem 10.
The following example verified the results given in Theorem 10.

Example 1. In cases and or 2, a similar result is presented below.

Theorem 11. Let be a prime with . Then,where .

Proof. (1)If and , from the definition of and the properties of Legendre’s symbol modulo , we haveLet , and we haveFrom the properties of , we haveThen, .Then, .Then, .We can immediately deduce thatFrom Lemma 5, we haveFrom Lemma 7, , , and . Then,(2)Similarly, we can give the estimate for :We replace by , and then,Since , , which impliesWe can immediately obtain that

Proposition 12. Let be a prime with . Then, , when .

Proof. From the definition of and , we can obtainFurthermore,For convenience, we assumeFrom the above identities, we haveFrom the properties of character sums, we haveCombining the above, the proposition is proved.

5. Conclusions

Counting the number of special sequences made of quadratic residues or nonresidues has been of common interests of many researchers for many years. Among those sequences of interests are those made of consecutive quadratic residues or nonresidues, which belong to the family of arithmetic sequences with common difference 1. In this paper, we apply analytic number theory methods, in particular, properties of Legendre’s symbol and character sum modulo of a prime number , to enumerate arithmetic sequences of quadratic residues (or nonresidues) with common difference and of length . The corresponding numbers are denoted as and .

The main results of this paper are stated in Theorems 8, 10, and 11. Theorem 8 gives exact formulas for , , , and . Theorems 10 and 11 claim thatand provide an upper bound and a lower bound for each of and .

Further work includes the study of and for larger values of and .

Data Availability

No data were used to support this study.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This study was supported by the Natural Science Basic Research Program of Shaanxi (Program no. 2022JQ-058).