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 A001988 M4333 N1888 #35 Feb 04 2022 02:01:57 %S A001988 7,7,127,463,463,487,1423,33247,73327,118903,118903,118903,454183, %T A001988 773767,773767,773767,773767,86976583,125325127,132690343,788667223, %U A001988 788667223,1280222287,2430076903,10703135983,10703135983,10703135983 %N A001988 Let p be the n-th odd prime. a(n) is the least prime congruent to 7 modulo 8 such that Legendre(-a(n), q) = -Legendre(-1, q) for all odd primes q <= p. %C A001988 Numbers so far are all congruent to 7 (mod 24). - _Ralf Stephan_, Jul 07 2003 %D A001988 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). %D A001988 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A001988 D. H. Lehmer, E. Lehmer and D. Shanks, <a href="https://doi.org/10.1090/S0025-5718-1970-0271006-X">Integer sequences having prescribed quadratic character</a>, Math. Comp., 24 (1970), 433-451. %H A001988 D. H. Lehmer, E. Lehmer and D. Shanks, <a href="/A002189/a002189.pdf">Integer sequences having prescribed quadratic character</a>, Math. Comp., 24 (1970), 433-451 [Annotated scanned copy] %o A001988 (PARI) isok(p, oddpn) = {forprime(q=3, oddpn, if (kronecker(p, q) != -kronecker(-1, q), return (0));); return (1);} %o A001988 a(n) = {oddpn = prime(n+1); forprime(p=3, , if ((p%8) == 7, if (isok(p, oddpn), return (p));););} \\ _Michel Marcus_, Oct 18 2017 %o A001988 (Python) %o A001988 from sympy import legendre_symbol as L, primerange, prime, nextprime %o A001988 def isok(p, oddpn): %o A001988 for q in primerange(3, oddpn + 1): %o A001988 if L(p, q)!=-L(-1, q): return 0 %o A001988 return 1 %o A001988 def a(n): %o A001988 oddpn=prime(n + 1) %o A001988 p=3 %o A001988 while True: %o A001988 if p%8==7: %o A001988 if isok(p, oddpn): return p %o A001988 p=nextprime(p) # _Indranil Ghosh_, Oct 23 2017, after PARI code by _Michel Marcus_ %Y A001988 Cf. A001990. %K A001988 nonn %O A001988 1,1 %A A001988 _N. J. A. Sloane_ %E A001988 Better name and more terms from _Sean A. Irvine_, Mar 06 2013 %E A001988 Name and offset corrected by _Michel Marcus_, Oct 18 2017