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.

A350460 Positive integers k such that if p is the next prime > k then p - k is prime.

Original entry on oeis.org

3, 5, 8, 9, 11, 14, 15, 17, 20, 21, 24, 26, 27, 29, 32, 34, 35, 38, 39, 41, 44, 45, 48, 50, 51, 54, 56, 57, 59, 62, 64, 65, 68, 69, 71, 74, 76, 77, 80, 81, 84, 86, 87, 90, 92, 94, 95, 98, 99, 101, 104, 105, 107, 110, 111, 114, 116, 120, 122, 124, 125, 128, 129
Offset: 1

Views

Author

Ryan Bresler, Jan 01 2022

Keywords

Comments

a(n) is only prime when n is the lesser of a twin prime pair (A001359). All other terms are composite.

Examples

			3 is a term because the next prime > 3 is 5, and 5 - 3 = 2, which is prime.
14 is a term because the next prime > 14 is 17, and 17 - 14 = 3, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[130], PrimeQ[NextPrime[#] - #] &] (* Amiram Eldar, Jan 01 2022 *)
  • PARI
    isok(k) = my(p=nextprime(k+1)); isprime(p-k); \\ Michel Marcus, Jan 01 2022
  • Python
    from sympy import isprime, nextprime
    def ok(n): return n > 0 and isprime(nextprime(n) - n)
    print([k for k in range(130) if ok(k)]) # Michael S. Branicky, Jan 01 2022