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 A307965 #8 May 14 2019 11:03:23 %S A307965 7,11,19,53,43,173,67,2477,8803,9173,32323,37123,163,74093,170957, %T A307965 360293,679733,2404147,2004917,69009533,51599563,155757067,96295483, %U A307965 146161723,1408126003,3519879677,2050312613,3341091163,78864114883,65315700413,1728061733,9447241877 %N A307965 a(n) is the least prime p = prime(k) > prime(n) such that A306530(k) = prime(n). %C A307965 This sequence is analogous to A000229, but for least prime quadratic residue modulo p. %C A307965 Note that a(n) is the least odd number m > prime(n) such that prime(n)^((m-1)/2) == 1 (mod m) and q^((m-1)/2) == -1 (mod m) for every prime q < prime(n). Such m is always an odd prime. %t A307965 f[n_] := Module[{p = Prime[n], q = 2}, While[JacobiSymbol[q, p] != 1, q = NextPrime[q]]; q]; a[n_] := Module[{p = Prime[n], k = n + 1}, While[f[k] != p, k++]; Prime[k]]; Array[a, 20] %o A307965 (PARI) f(n) = my(i=1, p = prime(n)); while(kronecker(prime(i), p)! = 1, i++); prime(i); \\ A306530 %o A307965 a(n) = my(p=prime(n), iq = p+1, q=nextprime(iq)); while(f(iq)!= p, iq++); prime(iq); \\ _Michel Marcus_, May 12 2019 %Y A307965 Cf. A000229, A306530. %K A307965 nonn %O A307965 1,1 %A A307965 _Amiram Eldar_ and _Thomas Ordowski_, May 08 2019