OFFSET
1,8
COMMENTS
a(n) > 0 for all n > 3. In fact, for any prime p > 5 one of 1^2 + 1 = 2, 2^2 + 1 = 5 and 3^2 + 1 = 10 is a quadratic residue modulo p. Similarly, if p > 7 is a prime not equal to 19, then k^2 - 1 is a quadratic residue modulo p for some positive integer k < sqrt(p). In fact, for any prime p > 7, one of 2^2 - 1 = 3, 3^2 - 1 = 8 and 5^2 - 1 = 24 is a quadratic residue modulo p.
See also A239957 for a similar conjecture involving primitive roots modulo primes. Note that a primitive root modulo an odd prime p must be a quadratic nonresidue modulo p.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
EXAMPLE
a(6) = 1 since 3^2 + 1 = 10 is a quadratic residue modulo prime(6) = 13.
a(7) = 1 since 1^2 + 1 = 2 is a quadratic residue modulo prime(7) = 17.
a(9) = 1 since 1^2 + 1 = 2 is a quadratic residue modulo prime(9) = 23.
a(10) = 1 since 2^2 + 1 = 5 is a quadratic residue modulo prime(10) = 29.
a(18) = 1 since 2^2 + 1 = 5 is a quadratic residue modulo prime(18) = 61.
MATHEMATICA
a[n_]:=Sum[If[JacobiSymbol[k^2+1, Prime[n]]==1, 1, 0], {k, 1, Sqrt[Prime[n]-1]}]
Table[a[n], {n, 1, 80}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 23 2014
STATUS
approved