This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A377380 #11 Oct 27 2024 10:46:30 %S A377380 1,2,11,41,26,5,671,89,59,1181,1991,3755,21521,34145,25994,137885, %T A377380 61106,1503029,2617439,1008551,2897081,22363295,33603926,36518450, %U A377380 79865294,185914490,593068985,2211452939,2120224529,1673286179,2644173521,1976870465 %N 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. %C A377380 a(n) == 2 (mod 3) for n >= 2. %e A377380 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. %p A377380 with(numtheory): %p A377380 N:= 20: %p A377380 V:= Vector(N): V[1]:= 1: count:= 1: %p A377380 for x from 2 by 3 while count < N do %p A377380 p:= 1: %p A377380 for m from 0 do %p A377380 p:= nextprime(p); %p A377380 if numtheory:-quadres(x,p) <> (-1)^m then break fi; %p A377380 od; %p A377380 if V[m] = 0 then %p A377380 V[m]:= x; count:= count+1; %p A377380 fi %p A377380 od: %p A377380 convert(V,list); %Y A377380 Cf. A096636, A377212. %K A377380 nonn %O A377380 1,2 %A A377380 _Robert Israel_, Oct 27 2024