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.

A024698 a(n) = (prime(n+1) - 1)/4 if this is an integer or (prime(n+1) + 1)/4 otherwise.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 15, 17, 18, 18, 20, 21, 22, 24, 25, 26, 27, 27, 28, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 45, 45, 48, 48, 49, 50, 53, 56, 57, 57, 58, 60, 60, 63, 64, 66, 67, 68, 69, 70, 71, 73, 77, 78, 78, 79, 83, 84, 87, 87, 88, 90, 92, 93, 95, 96, 97, 99, 100
Offset: 1

Views

Author

Keywords

Examples

			a(4)=3 because for p=11, (0,1), (3,4), (4,5) are the pairs of consecutive quadratic residues modulo p. - _Michael Somos_, Feb 17 2020
		

References

  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 283.

Programs

  • Maple
    [seq(ceil((ithprime(i)-1)/4),i=2..100)]; # Robert Israel, Jan 23 2018
  • Mathematica
    pi[n_]:=Module[{c=(Prime[n+1]-1)/4},If[IntegerQ[c],c,(Prime[n+1]+1)/4]]; Array[pi,80] (* Harvey P. Dale, May 19 2018 *)

Formula

a(n) = ceiling((prime(n+1)-1)/4). - Robert Israel, Jan 23 2018
a(n) = number of consecutive pairs of quadratic residues in 0,1,...,p-1 where p=prime(n+1). - Michael Somos, Feb 17 2020