OFFSET
2,2
EXAMPLE
a(5) = 38 because 38 is a quadratic residue modulo prime(5) = 11 but is not a quadratic residue modulo the previous odd primes 3, 5 and 7, and no number smaller than 38 works.
MAPLE
f:= proc(n) local k, p;
p:= 2;
for k from 2 do
p:= nextprime(p);
if numtheory:-quadres(n, p) = 1 then return k fi
od
end proc:
V:= Array(2..25): count:= 0:
for k from 2 while count < 24 do
v:= f(k);
if v > 0 and v <= 25 and V[v] = 0 then
V[v]:= k; count:= count+1;
fi;
od:
V[2]:= 0:
convert(V, list);
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Oct 20 2024
STATUS
approved