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 A088192 #32 Feb 16 2018 08:59:15 %S A088192 1,2,1,3,2,1,1,2,5,1,3,1,1,2,5,1,2,1,2,7,1,3,2,1,1,1,3,2,1,1,3,2,1,2, %T A088192 1,3,1,2,5,1,2,1,7,1,1,3,2,3,2,1,1,7,1,2,1,5,1,3,1,1,2,1,2,11,1,1,2,1, %U A088192 2,1,1,7,3,1,2,5,1,1,1,1,2,1,7,1,3,2,1,1,1,3,2,13,3,2,2,5,1,1,2,1 %N A088192 Distance between prime(n) and the largest quadratic residue modulo prime(n). %C A088192 a(n) = smallest m>0 such that -m is a quadratic residue modulo prime(n). %C A088192 a(n) = smallest m>0 such that prime(n) either splits or ramifies in the imaginary quadratic field Q(sqrt(-m)). Equals -A220862(n) except when n = 1. Cf. A220861, A220863. - _N. J. A. Sloane_, Dec 26 2012 %C A088192 The values are 1 or a prime number (easily provable!). The maximum occurring prime values increase very slowly: up to 10^5 terms the largest prime is 43. The primes do not appear in order. %D A088192 David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, Cor. 5.17, p. 105. - From _N. J. A. Sloane_, Dec 26 2012 %H A088192 Charles R Greathouse IV, <a href="/A088192/b088192.txt">Table of n, a(n) for n = 1..10000</a> %H A088192 Ferenc Adorjan, <a href="http://web.axelero.hu/fadorjan/qrp.pdf">The sequence of largest quadratic residues modulo the primes</a>. %H A088192 J. A. Bergstra, I. Bethke, <a href="http://arxiv.org/abs/1507.00548">A negative result on algebraic specifications of the meadow of rational numbers</a>, arXiv preprint arXiv:1507.00548 [math.RA], 2015-2016. %F A088192 a(n) = A053760(n) unless -1 is a quadratic residue mod prime(n). - _Charles R Greathouse IV_, Oct 31 2012 %t A088192 a[n_] := With[{p = Prime[n]}, If[JacobiSymbol[-1, p] > 0, 1, For[d = 2, True, d = NextPrime[d], If[JacobiSymbol[-d, p] >= 0, Return[d]]]]]; Array[a, 100] (* _Jean-François Alcover_, Feb 16 2018, after _Charles R Greathouse IV_ *) %o A088192 (PARI) qrp_pm(fr,to)= {/* The distance of largest QR modulo the primes from 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,p-m)); print(v) } %o A088192 (PARI) do(p)=if(kronecker(-1,p)>0, 1, forprime(d=2, p, if(kronecker(-d, p) >= 0, return(d)))) %o A088192 apply(do, primes(100)) \\ _Charles R Greathouse IV_, Oct 31 2012 %Y A088192 Records are (essentially) given by A147971. %Y A088192 Cf. A088190, A088191, A088193, A088194, A088195, A220861, A220862, A220863. %K A088192 easy,nonn %O A088192 1,2 %A A088192 Ferenc Adorjan (fadorjan(AT)freemail.hu), Sep 22 2003 %E A088192 Edited by _Max Alekseyev_, Oct 29 2012