OFFSET
2,1
LINKS
David A. Corneth, Table of n, a(n) for n = 2..10001
Eric Weisstein's World of Mathematics, Quadratic Residue.
MATHEMATICA
f[n_] := Block[{k = PrimePi[n]}, While[ JacobiSymbol[ n, Prime[k]] != 1, k++ ]; Prime[ k]]; Table[ f[n], {n, 2, 60}]
PROG
(PARI) a(n) = forprime(p = n + 1, oo, if(issquare(Mod(n, p)), return(p))) \\ Peter Schorn, May 13 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Robert G. Wilson v, Jul 27 2004
STATUS
approved