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.

A282721 Let p = n-th prime == 3 mod 8; a(n) = sum of quadratic residues mod p that are < p/2.

Original entry on oeis.org

1, 13, 32, 137, 306, 314, 555, 876, 1400, 1416, 1742, 2450, 3099, 3788, 4816, 5430, 6351, 7344, 8393, 9546, 12858, 13373, 15265, 17277, 16311, 18403, 19521, 22344, 21805, 23590, 25495, 26805, 30767, 30863, 31570, 35980, 40678, 43946, 45640, 49124, 50055, 52776, 58418, 66210, 71521, 71665, 83666, 81628
Offset: 1

Views

Author

N. J. A. Sloane, Feb 20 2017

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory):
    Ql:=[]; Qu:=[]; Q:=[]; Nl:=[]; Nu:=[]; N:=[]; Th:=[];
    for i1 from 1 to 300 do
    p:=ithprime(i1);
    if (p mod 8) = 3 then
    ql:=0; qu:=0; q:=0; nl:=0; nu:=0; n:=0;
    for j from 1 to p-1 do
    if legendre(j,p)=1 then
      q:=q+j;
      if j
  • Mathematica
    s[p_] := Total[Select[Range[Floor[p/2]], JacobiSymbol[#, p] == 1&]];
    s /@ Select[Range[3, 2000, 8], PrimeQ] (* Jean-François Alcover, Nov 17 2017 *)
  • Python
    from sympy import isprime
    def a(p):
        r=(p - 1)//2
        t=0
        for j in range(1, r + 1):
            q=(j**2)%p
            if q<=r:t+=q
        return t
    print([a(p) for p in range(3, 2001, 8) if isprime(p)]) # Indranil Ghosh, Mar 27 2017, translated from Maple code