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”).
%I #2 Apr 03 2023 10:36:10
%S 2,3,6,10,11,14,18,22,27,30,35,38,42,46,51,58,59,66,70,68,78,82,86,92,
%T 99,102,106,107,110,126,130,134,138,147,150,155,162,166,171,178,179,
%U 190,188,195,198,210,222,226,227,230,238,234,250,254,262,267,270,275,278
%N Largest number that is not a quadratic residue modulo prime(n).
%C These are sometimes called quadratic non-residues modulo p(n). Denote a(n) by LQnR(p_n).
%H Chris Caldwell: The Prime Pages <a href="https://t5k.org/glossary/page.php?sort=QuadraticResidue">Quadratic Residues</a>.
%H F. Adorjan, <a href="http://web.axelero.hu/fadorjan/qrp.pdf">The sequence of largest quadratic residues modulo the primes</a>.
%o (PARI) qnrp(fr,n)= {/* The largest QnR modulo the primes */ local(m,p,fl,jj,j,v=[]); fr=max(fr,2); for(i=fr,n,m=0; p=prime(i); jj=0; fl=2^p-1; j=2; while((j<=(p-1)/2),jj=(j^2)%p; fl-=2^jj; j++); j=p-1; while(m==0,if(bitand(2^j,fl),m=j); j--); v=concat(v,m)); print(v)}
%Y Cf. A088190, A088197, A088198, A088199, A088200, A088201.
%K easy,nonn
%O 2,1
%A Ferenc Adorjan (fadorjan(AT)freemail.hu), Sep 23 2003