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.

Showing 1-5 of 5 results.

A125615 Sum of the quadratic nonresidues of prime(n).

Original entry on oeis.org

0, 2, 5, 14, 33, 39, 68, 95, 161, 203, 279, 333, 410, 473, 658, 689, 944, 915, 1139, 1491, 1314, 1738, 1826, 1958, 2328, 2525, 2884, 2996, 2943, 3164, 4318, 4585, 4658, 5004, 5513, 6191, 6123, 6683, 7849, 7439, 8413, 8145, 10314, 9264, 9653, 10746, 11394
Offset: 1

Views

Author

Nick Hobson, Nov 30 2006

Keywords

Comments

For all n > 2, prime(n) divides a(n).

Examples

			The quadratic nonresidues of 7=prime(4) are 3, 5 and 6. Hence a(4) = 3+5+6 = 14.
		

References

  • D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 185.

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

  • Mathematica
    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 *)
  • PARI
    vector(47, n, p=prime(n); t=1; for(i=2, (p-1)/2, t+=((i^2)%p)); p*(p-1)/2-t)

Formula

If prime(n) = 4k+1 then a(n) = k(4k+1) = A076409(n).

A125613 Sum of the squares of the quadratic residues of prime(n).

Original entry on oeis.org

1, 1, 17, 21, 132, 351, 816, 874, 1104, 4031, 3286, 8473, 11726, 11868, 11233, 24857, 28143, 38247, 46766, 40754, 66722, 65017, 83249, 120150, 156364, 173013, 152955, 184147, 218763, 245436, 297053, 327500, 437030, 413803, 556217, 488334, 652335
Offset: 1

Views

Author

Nick Hobson, Nov 30 2006

Keywords

Comments

For all n > 3, prime(n) divides a(n).

Examples

			The quadratic residues of 7=prime(4) are 1, 2 and 4. Hence a(4)=1^2 + 2^2 + 4^2=21.
		

References

  • D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 185.

Crossrefs

Programs

  • Mathematica
    Table[Total[ResourceFunction["QuadraticResidues"][Prime[n]]^2],{n,37}] (* James C. McMahon, Dec 19 2024 *)
  • PARI
    vector(37, n, p=prime(n); t=1; for(i=2, (p-1)/2, t+=((i^2)%p)^2); t)

A125616 (Sum of the quadratic nonresidues of prime(n)) / prime(n).

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 7, 7, 9, 9, 10, 11, 14, 13, 16, 15, 17, 21, 18, 22, 22, 22, 24, 25, 28, 28, 27, 28, 34, 35, 34, 36, 37, 41, 39, 41, 47, 43, 47, 45, 54, 48, 49, 54, 54, 59, 59, 57, 58, 67, 60, 66, 64, 72, 67, 73, 69, 70, 72, 73, 78, 87, 78, 79, 84, 84, 89, 87, 88, 99, 96, 93, 96
Offset: 3

Views

Author

Nick Hobson, Nov 30 2006

Keywords

Comments

Always an integer for primes >= 5.

Examples

			The quadratic nonresidues of 7=prime(4) are 3, 5 and 6. Hence a(4) = (3+5+6)/7 = 2.
		

References

  • D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 185.

Crossrefs

Programs

  • Maple
    a:= proc(n) local p;
       p:= ithprime(n);
       convert(select(t->numtheory:-legendre(t,p)=-1, [$1..p-1]),`+`)/p;
    end proc:
    seq(a(n),n=3..100); # Robert Israel, May 10 2015
  • Mathematica
    Table[Total[Flatten[Position[Table[JacobiSymbol[a, p], {a, p - 1}], -1]]]/ p, {p, Prime[Range[3, 100]]}] (* Geoffrey Critzer, May 10 2015 *)
  • PARI
    vector(73, m, p=prime(m+2); t=1; for(i=2, (p-1)/2, t+=((i^2)%p)); (p-1)/2-t/p)

Formula

a(n) = A125615(n)/prime(n).
If prime(n) = 4k+1 then a(n) = k = A076410(n).

A125617 Sum of the squares of the quadratic nonresidues of prime(n).

Original entry on oeis.org

0, 4, 13, 70, 253, 299, 680, 1235, 2691, 3683, 6169, 7733, 10414, 13717, 22278, 23373, 38586, 35563, 51255, 76041, 60298, 96222, 103916, 110894, 143172, 165337, 206000, 218494, 206991, 229164, 377698, 413305, 410726, 471766, 535357, 647941, 625331
Offset: 1

Views

Author

Nick Hobson, Nov 30 2006

Keywords

Comments

For all n > 3, prime(n) divides a(n).

Examples

			The quadratic nonresidues of 7=prime(4) are 3, 5 and 6. Hence a(4) = 3^2 + 5^2 + 6^2 = 70.
		

References

  • D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 185.

Crossrefs

Programs

  • Mathematica
    Table[Total[Complement[Range[p-1],Union[Table[PowerMod[k, 2, p], {k, p}]]]^2],{p,Prime@Range[37]}] (* James C. McMahon, Dec 19 2024 *)
  • PARI
    vector(37, n, p=prime(n); t=1; for(i=2, (p-1)/2, t+=((i^2)%p)^2); p*(p-1)*(2*p-1)/6-t)

A125614 (Sum of the squares of the quadratic residues of prime(n)) / prime(n).

Original entry on oeis.org

3, 12, 27, 48, 46, 48, 139, 106, 229, 286, 276, 239, 469, 477, 627, 698, 574, 914, 823, 1003, 1350, 1612, 1713, 1485, 1721, 2007, 2172, 2339, 2500, 3190, 2977, 3733, 3234, 4155, 4306, 3688, 5023, 4848, 5529, 4791, 6356, 6517, 5655, 7051, 7452, 7964, 8845
Offset: 4

Views

Author

Nick Hobson, Nov 30 2006

Keywords

Comments

Always an integer for primes > 5.

Examples

			The quadratic residues of 7=prime(4) are 1, 2 and 4. Hence a(4) = (1^2 + 2^2 + 4^2)/7 = 3.
		

References

  • D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 185.

Crossrefs

Programs

  • Mathematica
    Table[Total[ResourceFunction["QuadraticResidues"][Prime[n]]^2/Prime[n]], {n,4, 50}] (* James C. McMahon, Dec 19 2024 *)
  • PARI
    vector(47, m, p=prime(m+3); t=1; for(i=2, (p-1)/2, t+=((i^2)%p)^2); t/p)

Formula

a(n) = A125613(n)/prime(n).
Showing 1-5 of 5 results.