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.

A282036 a(n) is the sum of quadratic nonresidues of A002145(n) (the n-th prime == 3 mod 4).

Original entry on oeis.org

2, 14, 33, 95, 161, 279, 473, 658, 944, 1139, 1491, 1738, 1826, 2884, 2996, 4318, 4585, 5004, 6191, 6683, 7849, 8413, 10314, 10746, 11394, 13157, 13393, 16013, 16566, 18936, 19783, 20376, 23946, 27057, 27804, 30883, 35541, 35232, 36384, 39832, 45671, 50858, 51363, 50059, 55097, 56040
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.
Cf. A002145.

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
    # Alternative:
    f:= p -> add(-k^2 mod p, k=1..(p-1)/2)::
    map(f, select(isprime, [seq(p,p=3..1000,4)])); # Robert Israel, Nov 09 2020
  • Mathematica
    f[p_] := Total[Range[p-1] ~Complement~ Table[Mod[k^2, p], {k, (p-1)/2}] ]; f /@ Select[Range[3, 1000, 4], PrimeQ] (* Jean-François Alcover, Feb 16 2018, after Robert Israel *)
  • PARI
    lista(nn) = forprime(p=2, nn, if(p%4==3, print1(sum(k=1, p-1, if (!issquare(Mod(k, p)), k)), ", "))); \\ Michel Marcus, Nov 09 2020

Formula

a(n) = Sum_{k=1..(A002145(n)-1)/2} (-k^2) mod A002145(n). - J. M. Bergot and Robert Israel, Nov 09 2020