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 A088190 #12 Nov 01 2024 09:35:29 %S A088190 1,1,4,4,9,12,16,17,18,28,28,36,40,41,42,52,57,60,65,64,72,76,81,88, %T A088190 96,100,100,105,108,112,124,129,136,137,148,148,156,161,162,172,177, %U A088190 180,184,192,196,196,209,220,225,228,232,232,240,249,256,258,268,268,276 %N A088190 Largest quadratic residue modulo prime(n). %C A088190 Denote a(n) by LQR(p_n). Observations (tested up to 20000 primes): - the sequence of largest QR modulo the primes (LQR(p_n) is 'almost' monotonic, - p_n-LQR(p_n) is either 1 or a prime value (see A088192) - if LQR(p_n)<=LQR(p_{n-1}) then p_n==7 mod 8 (when n>2) (see A088194) - if LQR(p_n)<=LQR(p_{n-1}) then p_n-LQR(p_n) is an odd prime, but never 5 (see A088195) For a similar set of sequences, related to quadratic non-residues, see A088196-A088201. %C A088190 From _Robert Israel_, Oct 31 2024: (Start) %C A088190 a(n) = prime(n)-1 if and only if n is 1 or in A080147. %C A088190 a(n) = prime(n)-2 if and only if prime(n) is in A007520. %C A088190 a(n) = prime(n)-3 if and only if prime(n) is in A107006. (End) %H A088190 Robert Israel, <a href="/A088190/b088190.txt">Table of n, a(n) for n = 1..10000</a> %H A088190 F. Adorjan, <a href="http://web.axelero.hu/fadorjan/qrp.pdf">The sequence of largest quadratic residues modulo the primes</a>. %F A088190 a(n) = max(r, r==j^2 mod p(n)|j=1, 2, ...(p(n)-1)/2) %p A088190 lqr:= proc(p) local k; %p A088190 for k from p-1 by -1 do if numtheory:-quadres(k,p) = 1 then return k fi od: %p A088190 end proc: %p A088190 seq(lqr(ithprime(i)),i=1..100); # _Robert Israel_, Oct 31 2024 %t A088190 a[n_] := With[{p = Prime[n]}, SelectFirst[Range[p - 1, 1, -1], JacobiSymbol[#, p] == 1&]]; Array[a, 100] (* _Jean-François Alcover_, Feb 16 2018 *) %o A088190 (PARI) qrp(fr,to)= {/* Sequence of the largest QR modulo the primes */ local(m,p,v=[]); for(i=fr,to,m=1; p=prime(i); j=2; while((j<=(p-1)/2)&&(m<p-1),m=max(m,(j^2)%p); j++); v=concat(v,m)); print(v) } %Y A088190 Cf. A007520, A080147, A088191, A088192, A088193, A088194, A088195, A088196, A088197, A088198, A088199, A088200, A088201, A107006. %K A088190 nonn %O A088190 1,3 %A A088190 Ferenc Adorjan (fadorjan(AT)freemail.hu), Sep 22 2003