OFFSET
1,1
COMMENTS
This sequence is analogous to A000229, but for least prime quadratic residue modulo p.
Note that a(n) is the least odd number m > prime(n) such that prime(n)^((m-1)/2) == 1 (mod m) and q^((m-1)/2) == -1 (mod m) for every prime q < prime(n). Such m is always an odd prime.
MATHEMATICA
f[n_] := Module[{p = Prime[n], q = 2}, While[JacobiSymbol[q, p] != 1, q = NextPrime[q]]; q]; a[n_] := Module[{p = Prime[n], k = n + 1}, While[f[k] != p, k++]; Prime[k]]; Array[a, 20]
PROG
(PARI) f(n) = my(i=1, p = prime(n)); while(kronecker(prime(i), p)! = 1, i++); prime(i); \\ A306530
a(n) = my(p=prime(n), iq = p+1, q=nextprime(iq)); while(f(iq)!= p, iq++); prime(iq); \\ Michel Marcus, May 12 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar and Thomas Ordowski, May 08 2019
STATUS
approved