PROCEEDINGS OF THE
AMERICAN MATHEMATICAL SOCIETY
Volume 130, Number 9, Pages 2503–2507
S 0002-9939(02)06600-5
Article electronically published on April 17, 2002
CONSECUTIVE NUMBERS
WITH THE SAME LEGENDRE SYMBOL
ZHI-HONG SUN
(Communicated by David E. Rohrlich)
Abstract. Let p be an odd prime, and Rp be a complete set of residues
(mod p). The goal of the paper is to determine
all the values
of n (n ∈ Rp )
such that n
= n+1
or n−1
= n
= n+1
, where p· is the Legendre
p
p
p
p
p
symbol.
1. Introduction
( p· )
be the Legendre symbol, and let Rp be a complete
Let p be an odd prime, and
set of residues modulo p. It is well known that (see [D])
n n o
n + 1
p−3
(1)
=
= 1, n ∈ Rp = [
]
n p
p
4
and
n n o
n + 1
p−1
=
= −1, n ∈ Rp = [
],
n p
p
4
(2)
where [·] is the greatest integer function.
In this paper we construct two or three consecutive numbers with the same value
of Legendre symbols by proving the following two theorems.
Theorem 1. Let p be an odd prime, Rp be a complete set of residues (mod p), and
let g be a primitive root of p. Then
o
n n
n + 1
=
= 1, n ∈ Rp
n p
p
n (g 2k − 1)2
p−3 o
]
(mod
p),
x
∈
R
,
k
=
1,
2,
.
.
.
,
[
= xk xk ≡
k
p
4g 2k
4
and
n
o
n
n + 1
=
= −1, n ∈ Rp
n p
p
n (g 2k−1 − 1)2
p−1 o
] .
(mod
p),
y
∈
R
,
k
=
1,
2,
.
.
.
,
[
= yk yk ≡
k
p
4g 2k−1
4
Received by the editors February 27, 2001.
2000 Mathematics Subject Classification. Primary 11A15; Secondary 11A07.
Key words and phrases. Prime, Legendre symbol.
c
2002
American Mathematical Society
2503
License or copyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
2504
ZHI-HONG SUN
Theorem 2. Let p be an odd prime, Fp = Z/pZ be the residue class ring modulo
p, and let Fp2 ⊃ Fp be the field with p2 elements. If g is a generator of the cyclic
subgroup of Fp∗2 (= Fp2 − {0}) of order p − ( −1
p ), then
o
n n − 1
n
n + 1
=
=
, n ∈ Fp
n
p
p
p
n
=
±
2g
p−( −1 )
p
+2s
4
g 4s − 1
p−3 o
] .
s = 1, 2, . . . , [
8
We remark that if p ≡ 1 (mod 4), then g is a primitive root (mod p), and if
p ≡ 3 (mod 4) we may take Fp2 = {a + bi | a, b ∈ Fp } and write g = a + bi with
a, b ∈ Fp and a2 + b2 = 1.
In the paper we also establish the following result.
Theorem 3. Let p be an odd prime, and n ∈ Z with n 6≡ 0, ±1 (mod p). Then
n
n + 1
(x2 + 1)2
n − 1
(mod p)
=
=
⇐⇒ n ≡
p
p
p
4x3 − 4x
for some x ∈ Z.
Throughout this paper, we denote the set of integers by Z as usual, and identify
( ap ) for a ∈ Z. For later convenience, we will also denote the Legendre
( a+pZ
p ) with
symbol np by χ(n).
2. Proof of Theorem 1
For k = 1, 2, . . . , (p−3)/2 let mk ∈ Rp be given by mk ≡ (g k −1)2 /(4g k ) (mod p).
Then mk + 1 ≡ (g k + 1)2 /(4g k ) (mod p). So χ(mk ) = χ(mk + 1) = (−1)k .
s+t
6≡ 1 (mod p) and so g s − g t 6≡
If s, t ∈ {1, 2, . . . , p−3
2 } with s 6= t, then g
s
t
s+t
s
(mod p). This implies that g + g −s 6≡ g t + g −t (mod p) and so
(g − g )/g
ms 6≡ mt (mod p). Since
n o p − 3 p − 1 p − 3
+
=
n χ(n) = χ(n + 1), n ∈ Rp =
4
4
2
by (1) and (2), we obtain
n χ(n) = χ(n + 1), n ∈ Rp = m1 , m2 , . . . , m p−3 .
2
k
This together with the fact that χ(mk ) = (−1) yields the result.
Remark 1. Let p > 3 be a prime, and n ∈ Z with p - n(n + 1). It follows from
Theorem 1 that
(x − 1)2
(mod p) for some x ∈ Z.
χ(n) = χ(n + 1) ⇐⇒ n ≡
4x
Using Theorem 1 one can also derive that
X
3 + 2χ(−1)
(mod p)
n≡
8
χ(n)=χ(n+1)=1
n∈Rp
and
X
χ(n)=χ(n+1)=−1
n∈Rp
n≡
3 − 2χ(−1)
(mod p).
8
License or copyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
CONSECUTIVE NUMBERS WITH THE SAME LEGENDRE SYMBOL
2505
3. Proof of Theorem 2
(p−χ(−1))/4+2s
/(g 4s −1). Then ns ∈ Fp2 since
For s ∈ {1, 2, . . . , [ p−3
8 ]} let ns = 2g
g 6= 1. We claim that ns ∈ Fp . If p ≡ 1 (mod 4), then g p−1 = 1 and so g p = g.
Hence g ∈ Fp and therefore ns ∈ Fp . If p ≡ 3 (mod 4), then g p+1 = g p−χ(−1) = 1
and hence g −1 = g p . So we have
4s
g
p+1
4 +2s
+ g −(
p+1
4 +2s)
=g
p+1
4 +2s
+ (g
p+1
4 +2s
)p = tr(g
p+1
4 +2s
) ∈ Fp ,
where tr(·) is the trace function. Now, using the above and the fact that g (p+1)/2 =
−1 we see that
ns = −
2
g
p+1
4 +2s
+ g −(
p+1
4 +2s)
∈ Fp .
So the assertion holds.
Since g (p−χ(−1))/2 = −1 it is easily seen that
2 ns − 1 = g (p−χ(−1))/4+2s + 1 (g 4s − 1),
2 ns = 1 + g (p−χ(−1))/4 g 2s (g 4s − 1),
2 4s
(g − 1).
ns + 1 = g (p−χ(−1))/4 + g 2s
From this one can check that
2
p−χ(−1)
p−χ(−1)
1 s
ns ± 1
g + g −s + g 4 ∓s + g −( 4 ∓s) .
=
ns
4
If p ≡ 3 (mod 4), then g k + g −k = g k + g kp = tr(g k ) ∈ Fp . If p ≡ 1 (mod 4),
then g ∈ Fp and so g k + g −k ∈ Fp . Thus, by the above we see that ns + 1 = ns x2
and ns − 1 = ns y 2 for some x, y ∈ Fp . Observe that ns (ns − 1)(ns + 1) 6= 0 since
1 6 s 6 (p − 3)/8. Then we have
χ(ns − 1) = χ(ns ) = χ(ns + 1) and hence
χ(−ns − 1) = χ(−ns ) = χ(−ns + 1).
2s−2t 2s+2t
,g
6= ±1 and so
If s, t ∈ {1, 2, . . . , [ p−3
8 ]} with s 6= t, then clearly g
2t
2s
2s
2t
(g ± g ) 6= g ± g . This implies
g
2s+2t
g 2s (g 4t − 1) 6= ±g 2t (g 4s − 1) and hence
g 2t
g 2s
=
6
±
.
g 4s − 1
g 4t − 1
Thus ns 6= ±nt .
According to [BEW] or [D], if b, c ∈ Z with b2 − 4c 6≡ 0 (mod p), then
(3)
p−1
X
χ(n2 + bn + c) = −1.
n=0
Set
(4)
R = |{n | χ(n − 1) = χ(n) = χ(n + 1) = 1, n ∈ Fp }|
and
(5)
N = |{n | χ(n − 1) = χ(n) = χ(n + 1) = −1, n ∈ Fp }|.
License or copyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
2506
ZHI-HONG SUN
Then we see that
p−2
X
(6)
1 + χ(n − 1) 1 + χ(n) 1 + χ(n + 1) = 8R
n=2
and
p−2
X
1 − χ(n − 1) 1 − χ(n) 1 − χ(n + 1) = 8N.
n=2
So, by (3) we have
p−2
X
8(R + N ) =
1 + χ(n − 1) 1 + χ(n) 1 + χ(n + 1)
n=2
+ 1 − χ(n − 1) 1 − χ(n) 1 − χ(n + 1)
p−2
X
1 + χ(n2 − n) + χ(n2 + n) + χ(n2 − 1)
=2
n=2
= 2(p − 3) + 2
n p−1
X
o
χ(n2 − n) + χ(n2 + n) + χ(n2 − 1) − 2χ(2) − χ(−1)
n=0
= 2(p − 3) − 6 − 4χ(2) − 2χ(−1) = 16[
p−3
].
8
That is,
R + N = 2[
p−3
].
8
Now, combining the above we prove the theorem.
Remark 2. Let p ≡ 1 (mod 4) be a prime, p = a2 + b2 (a, b ∈ Z), a ≡ 1 (mod 4),
and g be a primitive root of p. If R and N are defined by (4) and (5) respectively,
Pp−1 3 Pp−1 using (3), (6) and the fact that n=0 np = 0 and n=0 n p−n = −2 p2 a (cf.
[J], [BE, Theorem 4.4]) we see that
R=
p−1
1
1X
1 + χ(n − 1) 1 + χ(n) 1 + χ(n + 1) − 1 − χ(2)
8 n=0
2
p−1
X
o
1
1n
p+
=
χ(n2 − n) + χ(n2 + n) + χ(n2 − 1) + χ(n3 − n) − 1 − χ(2)
8
2
n=0
1
(p − 3 − 2χ(2)a) − 1 −
8
(
p−17
− a−1
if
8
4
= p−5
a−1
+
if
8
4
=
and therefore
p−3
]−R =
N = 2[
8
1
χ(2)
2
p ≡ 1 (mod 8),
p ≡ 5 (mod 8)
(
p−1
8
p−5
8
+
−
a−1
4
a−1
4
if
if
p ≡ 1 (mod 8),
p ≡ 5 (mod 8).
License or copyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
CONSECUTIVE NUMBERS WITH THE SAME LEGENDRE SYMBOL
2507
4. Proof of Theorem 3
Let Q0 (p) be defined as in [S]. From [S, Theorem 2.4] and [S, Corollary 3.2] we
see that
n
n + 1
n − 1
=
=
⇐⇒ n2 ≡ k 2 + 1 (mod p) for some k ∈ Q0 (p)
p
p
p
x4 − 6x2 +1 2
+1 (mod p) for some x ∈ Z
⇐⇒ n2 ≡
4x3 − 4x
(x2 + 1)4
(mod p) for some x ∈ Z
⇐⇒ n2 ≡
(4x3 − 4x)2
(x2 + 1)2
(mod p) for some x ∈ Z.
⇐⇒ n ≡
4x3 − 4x
So the theorem is proved.
References
B.C. Berndt and R.J. Evans, Sums of Gauss, Jacobi, and Jacobsthal, J. Number Theory
11 (1979), 349-398. MR 81j:10054
[BEW] B.C. Berndt, R.J. Evans and K.S. Williams, Gauss and Jacobi Sums, John Wiley & Sons,
Inc., New York, Chichester, 1998, p. 58. MR 99d:11092
[D]
H. Davenport, The Higher Arithmetic, 5th edition, Cambridge University Press, London,
New York, 1982, pp. 74-76. MR 84a:10001
[J]
E. Jacobsthal, Über die Darstellung der Primzahlen der Form 4n + 1 als Summe zweier
Quadrate, J. Reine Angew. Math. 132 (1907), 238-245.
[S]
Zhi-Hong Sun, Supplements to the theory of quartic residues, Acta Arith. 97 (2001),
361-377. MR 2002c:11007
[BE]
Department of Mathematics, Huaiyin Teachers College, Huaian, Jiangsu 223001, People’s Republic of China
E-mail address: [email protected]
License or copyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
© Copyright 2026 Paperzz