A376999
a(n) is the least number k that is a quadratic residue modulo prime(n) but is a quadratic nonresidue modulo all previous odd primes.
Original entry on oeis.org
0, 5, 2, 38, 17, 83, 362, 167, 227, 2273, 398, 5297, 64382, 69467, 116387, 238262, 214037, 430022, 5472953, 9481097, 8062073, 41941577, 86374763, 312521282
Offset: 2
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.
-
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);
A385050
a(n) is the least positive number k such that n is the greatest m such that k is a quadratic residue mod prime(i) for i=1..m and {k mod prime(i): i=1..m} are all distinct.
Original entry on oeis.org
1, 3, 4, 184, 9, 1479, 20799, 31509, 162094, 83554, 828844, 895449, 4631104, 86925309, 97476129, 14684224, 33547264, 5381151099, 516743824, 1958770564, 112746608529, 3046156864, 373079083204, 1394424964, 297469886464, 1596601563489, 976001733184, 33344131402059
Offset: 1
a(1) = 1: |{1}| = 1: 1 mod 2 = 1^2 mod 2, terminates at 1 mod 3 (not distinct: repeats 1 mod 2).
a(2) = 3: |{1, 0}| = 2: 3 mod 2 = 1^2 mod 2, 3 mod 3 = 0^2 mod 3, terminates at 3 mod 5 (nonsquare).
a(3) = 4: |{0, 1, 4}| = 3.
a(4) = 184: |{0, 1, 4, 2}| = 4 (2 = 3^2 mod 7).
a(5) = 9: |{1, 0, 4, 2, 9}| = 5.
a(6) = 1479: |{1, 0, 4, 2, 5, 10}| = 6.
-
a(n)={my(v=List); for(k=1, oo, my(m=Map); for(i=1, oo, my(p=prime(i), kp=k%p); if(i>#v, listput(v, Map); for(j=0, (p-p%2)/2, mapput(v[i], j^2%p, 1))); if(mapisdefined(v[i], kp) && !mapisdefined(m, kp), mapput(m, kp, 1); next); if(i-1==n, return(k)); break))}
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.
Original entry on oeis.org
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
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.
-
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);
Showing 1-3 of 3 results.
Comments