Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #16 Jul 02 2020 15:50:42
%S 7,11,5,11,19,19,17,11,13,19,13,17,31,17,17,19,23,31,29,37,29,29,29,
%T 29,37,37,29,53,37,41,41,37,37,43,37,41,43,41,41,43,47,53,53,59,53,53,
%U 59,53,71,59,53,59,67,67,61,59,61,67,61,73,67,83,67,67,97,73,83,73,73,73
%N Smallest prime p greater than n for which n is a quadratic residue mod p.
%H David A. Corneth, <a href="/A097152/b097152.txt">Table of n, a(n) for n = 2..10001</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/QuadraticResidue.html">Quadratic Residue</a>.
%t f[n_] := Block[{k = PrimePi[n]}, While[ JacobiSymbol[ n, Prime[k]] != 1, k++ ]; Prime[ k]]; Table[ f[n], {n, 2, 60}]
%o (PARI) a(n) = forprime(p = n + 1, oo, if(issquare(Mod(n, p)), return(p))) \\ _Peter Schorn_, May 13 2020
%Y Cf. A097143.
%K nonn,easy
%O 2,1
%A _Robert G. Wilson v_, Jul 27 2004