OFFSET
1,3
REFERENCES
J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 283.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
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
EXAMPLE
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
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved