OFFSET
1,1
COMMENTS
Least prime p > prime(n+1) such that p is a quadratic residue mod the first n odd primes 3, 5, 7, 11, ..., prime(n+1).
Least odd prime p such that the Legendre symbol (p|q) = 1 for q = 3, 5, 7, 11, ..., prime(n+1).
LINKS
FORMULA
EXAMPLE
Let f(p) = list of Legendre (p|q) for q = 3, 5, 7, 11, 13, 17, 19, 23, ...
Then f(p) is
p=3: 0, -1, -1, 1, 1, -1, -1, 1, ...
p=5: -1, 0, -1, 1, -1, -1, 1, -1, ...
p=7: 1, -1, 0, -1, -1, -1, 1, -1, ...
p=11: -1, 1, 1, 0, -1, -1, 1, -1, ...
p=13: 1, -1, -1, -1, 0, 1, -1, 1, ...
p=17: -1, -1, -1, -1, 1, 0, 1, -1, ...
p=19: 1, 1, -1, -1, -1, 1, 0, -1, ...
f(7) is the first list that begins with 1, so a(1) = 7.
f(19) is the first list that begins with 1, 1, so a(2) = 19.
MATHEMATICA
Table[p = Prime[n+2]; While[Length[Select[Prime[Range[2, n + 1]], JacobiSymbol[p, #] == 1 &]] < n, p = NextPrime[p]]; p, {n, 1, 18}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Jonathan Sondow, Feb 15 2014
STATUS
approved