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.

A356079 Primes p such that p+6, p-6, 2*p+3 and 2*p-3 are prime.

Original entry on oeis.org

13, 17, 53, 67, 157, 563, 613, 647, 1187, 1453, 1663, 4007, 4133, 5443, 5743, 6073, 6863, 7823, 8747, 11833, 12113, 12583, 12653, 15467, 21997, 23747, 25463, 25673, 26183, 41017, 42683, 59447, 60337, 65173, 67427, 68443, 75527, 80783, 89527, 94433, 95917, 100517, 101203, 104003, 110603, 111773
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jul 25 2022

Keywords

Comments

p, q, 2*p+q, 2*p-q, p+2*q and p-2*q are all prime if and only if q = 3 and p is in this sequence.

Examples

			a(3) = 53 is a term because 53, 53+6 = 59, 53-6 = 47, 2*53 + 3 = 109 and 2*53 - 3 = 103 are all prime.
		

Programs

  • Maple
    filter:= proc(p) andmap(isprime,[p,p+6,p-6,2*p+3,2*p-3]) end proc:
    select(filter, [seq(i,i=3..200000,2)]);
  • Mathematica
    Select[Prime[Range[10^4]], AllTrue[{# - 6, # + 6, 2*# - 3, 2*# + 3}, PrimeQ] &] (* Amiram Eldar, Jul 25 2022 *)
  • Python
    from sympy import isprime
    def ok(p): return all(isprime(k) for k in [p, p+6, p-6, 2*p+3, 2*p-3])
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Jul 25 2022