login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A377380
a(n) is the first positive number k such that k is alternately a quadratic residue and nonresidue modulo the first n primes, but not the n+1'th.
0
1, 2, 11, 41, 26, 5, 671, 89, 59, 1181, 1991, 3755, 21521, 34145, 25994, 137885, 61106, 1503029, 2617439, 1008551, 2897081, 22363295, 33603926, 36518450, 79865294, 185914490, 593068985, 2211452939, 2120224529, 1673286179, 2644173521, 1976870465
OFFSET
1,2
COMMENTS
a(n) == 2 (mod 3) for n >= 2.
EXAMPLE
a(3) = 11 because 11 is a quadratic residue mod 2, a nonresidue mod 3, a residue mod 5, but a residue mod 7, and no smaller number works.
MAPLE
with(numtheory):
N:= 20:
V:= Vector(N): V[1]:= 1: count:= 1:
for x from 2 by 3 while count < N do
p:= 1:
for m from 0 do
p:= nextprime(p);
if numtheory:-quadres(x, p) <> (-1)^m then break fi;
od;
if V[m] = 0 then
V[m]:= x; count:= count+1;
fi
od:
convert(V, list);
CROSSREFS
Sequence in context: A335629 A000822 A290175 * A154813 A168367 A247101
KEYWORD
nonn
AUTHOR
Robert Israel, Oct 27 2024
STATUS
approved