cp's OEIS Frontend

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.

A307965 a(n) is the least prime p = prime(k) > prime(n) such that A306530(k) = prime(n).

Original entry on oeis.org

7, 11, 19, 53, 43, 173, 67, 2477, 8803, 9173, 32323, 37123, 163, 74093, 170957, 360293, 679733, 2404147, 2004917, 69009533, 51599563, 155757067, 96295483, 146161723, 1408126003, 3519879677, 2050312613, 3341091163, 78864114883, 65315700413, 1728061733, 9447241877
Offset: 1

Views

Author

Amiram Eldar and Thomas Ordowski, May 08 2019

Keywords

Comments

This sequence is analogous to A000229, but for least prime quadratic residue modulo p.
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.

Crossrefs

Programs

  • Mathematica
    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]
  • PARI
    f(n) = my(i=1, p = prime(n)); while(kronecker(prime(i), p)! = 1, i++); prime(i); \\ A306530
    a(n) = my(p=prime(n), iq = p+1, q=nextprime(iq)); while(f(iq)!= p, iq++); prime(iq); \\ Michel Marcus, May 12 2019