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.

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

Original entry on oeis.org

2, 35, 108, 567, 1073, 1386, 2132, 3551, 5330, 6003, 8262, 9968, 13860, 16046, 19625, 24957, 29376, 34155, 37541, 44793, 54758, 61217, 68036, 75215, 77688, 85347, 93366, 98912, 101745, 107531, 119583, 129042, 135548, 145607, 149040, 170478, 193356, 205335, 213521, 230373, 243432, 256851, 280016, 294395
Offset: 1

Views

Author

N. J. A. Sloane, Feb 20 2017

Keywords

Comments

This is also the (sum of quadratic nonresidues mod p that are < p/2) + (sum of all quadratic nonresidues mod p) (= A282721 + A282723 = A282724 + A282726).

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
    v[x_, r_] := If[x <= r, 2*x, x];
    f[p_] := Module[{r}, r = (p-1)/2; Sum[v[PowerMod[j, 2, p], r], {j, 1, r}]];
    f /@ Select[Range[3, 1000, 8], PrimeQ] (* Jean-François Alcover, Nov 27 2017, after Robert Israel *)
  • Python
    from sympy import isprime
    def v(x, r):
        return 2*x if x<=r else x
    def a(p):
        r=(p - 1)//2
        return sum(v((j**2)%p, r) for j in range(1, r + 1))
    print([a(p) for p in range(3, 2001, 8) if isprime(p)]) # Indranil Ghosh, Mar 27 2017 translated from  Robert Israel's Maple program