OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(p) local q;
q:= p;
do
q:= nextprime(q);
if NumberTheory:-QuadraticResidue(q, p)=1 then return q fi
od
end proc:
A[1]:= 2: for i from 2 to 100 do A[i]:= f(A[i-1]) od:
seq(A[i], i=1..100); # Robert Israel, Jan 06 2023
MATHEMATICA
a[1] = 2; a[2] = 3; a[n_] := a[n] = For[p = NextPrime[a[n-1]], True, p = NextPrime[p], If[JacobiSymbol[p, a[n-1]] == 1, Return[p]]];
a /@ Range[55] (* Jean-François Alcover, Dec 28 2019 *)
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Name corrected by Robert Israel, Jan 06 2023
STATUS
approved