login
A178154
Sum_{a=1..(p-1)/2} LegendreSymbol(a, p) for primes p == 3 (mod 4).
6
1, 1, 3, 3, 3, 3, 3, 5, 9, 3, 7, 5, 9, 5, 9, 5, 15, 9, 7, 3, 11, 15, 13, 9, 9, 7, 15, 15, 21, 13, 11, 9, 9, 19, 9, 15, 19, 9, 9, 17, 27, 21, 15, 15, 7, 21, 25, 7, 27, 9, 21, 15, 9, 27, 15, 21, 25, 13, 15, 13, 9, 23, 33, 15, 15, 31, 13, 15, 21, 15, 15, 21, 9, 21, 33, 21, 21, 9, 29, 9, 31, 19
OFFSET
1,3
COMMENTS
Wenpeng Zhang proves that a(n) > 0. - Peter Luschny, Jun 07 2025
From Jianing Song, Apr 02 2026: (Start)
Let d < 0 be a fundamental discriminant, and chi be the unique primitive quadratic character modulo |d|. Then
(2-chi(2))*(-1/|d|)*Sum_{i=1..|d|} i*chi(i) = Sum_{i=1..|d|/2} chi(i)
(see pp. 345-346 of Borevich-Shafarevich's "Number Theory"). Note that (-1/|d|)*Sum_{i=1..|d|} i*chi(i) is precisely equal to the class number h(d) of the quadratic field Q(sqrt(d)) for d < -4. In particular if -d is a prime congruent to 3 modulo 4 other than 3, then Sum_{i=1..(p-1)/2} (i/p) = (2-(2/p))*h(-p), where (a/p) is the Legendre symbol. (End)
REFERENCES
Richard Kenneth Guy, Unsolved Problems in Number Theory, Springer-Verlag, Berlin, 1994, pp. 244.
LINKS
Z. I. Borevich and I. R. Shafarevich, Number Theory. Academic Press, NY, 1966, pp. 345-346.
Wenpeng Zhang, An old number theory problem related to the Legendre symbol, arXiv:2506.02434 [math.HO], Jun. 2025.
FORMULA
A178153 for primes p=3 (mod 4).
a(n) = A002143(n) if prime(n) == 7 (mod 8), 3*A002143(n) if prime(n) == 3 (mod 8) and prime(n) > 3. - Jianing Song, Apr 02 2026
MAPLE
P := upto -> select(n -> isprime(n) and modp(n, 4) = 3, [seq(1..upto)]):
a := p -> add(NumberTheory:-LegendreSymbol(a, p), a = 1..(p-1)/2):
seq(a(p), p in P(940)); # Peter Luschny, Jun 07 2025
MATHEMATICA
Table[Length[Select[Range[(p-1)/2], JacobiSymbol[ #, p]==1&]] - Length[Select[Range[(p+1)/2, p-1], JacobiSymbol[ #, p]==1&]], {p, Select[Prime[Range[200]], Mod[ #, 4]==3&]}]
PROG
(SageMath)
def h(p):
if not (is_prime(p) and mod(p, 4) == 3): return 0
return sum(kronecker(j, p) for j in range(1, (p + 1)//2))
aList = lambda upto: [h(n) for n in range(2, upto) if h(n) > 0]
print(aList(944)) # Peter Luschny, Jun 07 2025
(PARI) S(p) = sum(i=1, p/2, kronecker(i, p));
forprime(p=2, 1000, if(p%4==3, print1(S(p), ", "))) \\ Jianing Song, Apr 02 2026
(PARI) S(p) = if(p==3, 1, qfbclassno(-p) * (9-p%8)/2);
forprime(p=2, 1000, if(p%4==3, print1(S(p), ", "))) \\ Jianing Song, Apr 02 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, May 21 2010
EXTENSIONS
Name simplified by Peter Luschny, Jun 07 2025
STATUS
approved