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.
%I A125615 #21 Dec 19 2024 23:42:37 %S A125615 0,2,5,14,33,39,68,95,161,203,279,333,410,473,658,689,944,915,1139, %T A125615 1491,1314,1738,1826,1958,2328,2525,2884,2996,2943,3164,4318,4585, %U A125615 4658,5004,5513,6191,6123,6683,7849,7439,8413,8145,10314,9264,9653,10746,11394 %N A125615 Sum of the quadratic nonresidues of prime(n). %C A125615 For all n > 2, prime(n) divides a(n). %D A125615 D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 185. %H A125615 Nick Hobson, <a href="/A125615/b125615.txt">Table of n, a(n) for n = 1..1000</a> %H A125615 Christian Aebi and Grant Cairns. <a href="http://arxiv.org/abs/1512.00896">Sums of Quadratic residues and nonresidues</a>, arXiv preprint arXiv:1512.00896 [math.NT], 2015. %F A125615 If prime(n) = 4k+1 then a(n) = k(4k+1) = A076409(n). %e A125615 The quadratic nonresidues of 7=prime(4) are 3, 5 and 6. Hence a(4) = 3+5+6 = 14. %t A125615 Table[p=Prime[n];Total[Complement[Range[p-1],Union[Table[PowerMod[k, 2, p], {k, p}]]]],{n,47}] (* _James C. McMahon_, Dec 19 2024 *) %o A125615 (PARI) vector(47, n, p=prime(n); t=1; for(i=2, (p-1)/2, t+=((i^2)%p)); p*(p-1)/2-t) %Y A125615 Cf. A076409, A076410, A125613-A125618. %Y A125615 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. %K A125615 easy,nonn %O A125615 1,2 %A A125615 _Nick Hobson_, Nov 30 2006