cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A178154 Sum_{a=1..(p-1)/2} LegendreSymbol(a, p) for primes p == 3 (mod 4).

Original entry on oeis.org

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

Views

Author

T. D. Noe, May 21 2010

Keywords

Comments

Wenpeng Zhang proves that a(n) > 0. - Peter Luschny, Jun 07 2025

References

  • Richard Kenneth Guy, Unsolved Problems in Number Theory, Springer-Verlag, Berlin, 1994, pp. 244.

Crossrefs

Programs

  • 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&]}]
  • 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

Formula

A178153 for primes p=3 (mod 4).

Extensions

Name simplified by Peter Luschny, Jun 07 2025

A178151 The number of quadratic residues (mod p) less than p/2, where p=prime(n).

Original entry on oeis.org

1, 1, 2, 4, 3, 4, 6, 7, 7, 9, 9, 10, 12, 14, 13, 19, 15, 18, 21, 18, 22, 25, 22, 24, 25, 28, 31, 27, 28, 34, 40, 34, 39, 37, 41, 39, 42, 47, 43, 52, 45, 54, 48, 49, 54, 57, 59, 64, 57, 58, 67, 60, 73, 64, 72, 67, 73, 69, 70, 75, 73, 81, 87, 78, 79, 87, 84, 94, 87, 88, 99, 96, 93
Offset: 2

Views

Author

T. D. Noe, May 21 2010

Keywords

Comments

Sequence A063987 lists the quadratic residues (mod p) for each prime p. When p=1 (mod 4), there are an equal number of quadratic residues less than p/2 and greater than p/2. When p=3 (mod 4), there are always more quadratic residues less than p/2 than greater than p/2.

Examples

			The quadratic residues of 19, the 8th prime, are 1, 4, 5, 6, 7, 9, 11, 16, 17. Six of these are less than 19/2. Hence a(8)=6.
		

Crossrefs

Programs

  • Maple
    A178151 := proc(n)
        local r,a,p;
        p := ithprime(n) ;
        a := 0 ;
        for r from 1 to p/2 do
            if numtheory[legendre](r,p) =1 then
                a := a+1 ;
            end if;
        end do:
        a;
    end proc: # R. J. Mathar, Feb 10 2017
  • Mathematica
    Table[p=Prime[n]; Length[Select[Range[(p-1)/2], JacobiSymbol[ #,p]==1&]], {n,2,100}]

A178152 The number of quadratic residues (mod p) greater than p/2, where p=prime(n).

Original entry on oeis.org

0, 1, 1, 1, 3, 4, 3, 4, 7, 6, 9, 10, 9, 9, 13, 10, 15, 15, 14, 18, 17, 16, 22, 24, 25, 23, 22, 27, 28, 29, 25, 34, 30, 37, 34, 39, 39, 36, 43, 37, 45, 41, 48, 49, 45, 48, 52, 49, 57, 58, 52, 60, 52, 64, 59, 67, 62, 69, 70, 66, 73, 72, 68, 78, 79, 78, 84, 79, 87, 88, 80, 87, 93, 90
Offset: 2

Views

Author

T. D. Noe, May 21 2010

Keywords

Comments

Sequence A063987 lists the quadratic residues (mod p) for each prime p. When p=1 (mod 4), there are an equal number of quadratic residues less than p/2 and greater than p/2. When p=3 (mod 4), there are always more quadratic residues less than p/2 than greater than p/2.

Examples

			The quadratic residues of 19, the 8th prime, are 1, 4, 5, 6, 7, 9, 11, 16, 17. Three of these are greater than 19/2. Hence a(8)=3.
		

Crossrefs

Programs

  • Mathematica
    Table[p=Prime[n]; Length[Select[Range[(p+1)/2,p-1], JacobiSymbol[ #,p]==1&]], {n,2,100}]
Showing 1-3 of 3 results.