A282035 Sum of quadratic residues of (n-th prime == 3 mod 4).
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
Keywords
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..5000
- Aebi, Christian, and Grant Cairns. Sums of Quadratic residues and nonresidues, arXiv preprint arXiv:1512.00896 (2015).
Crossrefs
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