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.

A282035 Sum of quadratic residues of (n-th prime == 3 mod 4).

Original entry on oeis.org

1, 7, 22, 76, 92, 186, 430, 423, 767, 1072, 994, 1343, 1577, 2369, 2675, 3683, 3930, 4587, 5134, 6520, 6012, 7518, 7831, 8955, 10761, 11596, 12258, 12428, 14809, 15517, 16802, 19527, 23025, 21148, 26811, 29148, 28720, 31929, 35247, 33321, 41900, 41807, 44778, 47844, 51856, 52771, 51253, 57466
Offset: 1

Views

Author

N. J. A. Sloane, Feb 20 2017

Keywords

Crossrefs

Sums of residues, nonresidues, and their differences, for p == 1 mod 4, p == 3 mod 4, and all p: A171555; A282035, A282036, A282037; A076409, A125615, A282038.

Programs

  • Maple
    with(numtheory):
    a:=[]; m:=[]; d:=[];
    for i1 from 1 to 200 do
    p:=ithprime(i1);
    if (p mod 4) = 3 then
    sp:=0; sm:=0;
    for j from 1 to p-1 do
    if legendre(j,p)=1 then sp:=sp+j; else sm:=sm+j; fi; od;
    a:=[op(a),sp]; m:=[op(m),sm]; d:=[op(d),sm-sp];
    fi;
    od:
    a; m; d; # A282035, A282036, A282037
  • Mathematica
    Table[Table[Mod[a^2, p], {a, 1, (p-1)/2}]//Total, {p, Select[Prime[Range[100]], Mod[#, 4]==3 &]}] (* Vincenzo Librandi, Feb 21 2017 *)
    Table[Total[PowerMod[#,2,n]&/@Range[n/2]],{n,Select[Prime[Range[100]],Mod[#,4]==3&]}] (* Harvey P. Dale, Dec 11 2024 *)
  • PARI
    do(p)=sum(k=1,p-1,k^2%p)/2
    apply(do, select(p->p%4==3, primes(100))) \\ Charles R Greathouse IV, Feb 21 2017