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.

A386540 Primes p such that 2p - 1, 3p - 2, (p + 1)/2, and (p + 2)/3 are also prime.

Original entry on oeis.org

37, 2557, 3061, 5581, 88741, 124021, 157081, 178537, 216217, 216757, 217057, 330661, 344821, 352081, 387577, 423481, 459397, 477577, 521137, 790861, 806521, 865957, 869521, 1369657, 1517881, 1673401, 1704397, 1710661, 1970257, 2132797, 2292781, 2361781, 2680141
Offset: 1

Views

Author

Holger Wallenta, Jul 25 2025

Keywords

Comments

All terms are congruent to 1 modulo 12.
Let q = (p + 1)/2 and r = (p + 2)/3; then 3r = 2q + 1.

Examples

			37 is a term, since it is prime and 2*37 - 1 = 73, 3*37 - 2 = 109, (37 + 1)/2 = 19 and (37 + 2)/3 = 13 are all prime.
		

Crossrefs

Intersection of A036570 and A174734.

Programs

  • Maple
    select(p -> andmap(isprime,[p, 2*p-1,3*p-2,(p+1)/2,(p+2)/3]), [seq(1+12*i,i=1..10^6)]); # Robert Israel, Jul 25 2025
  • Mathematica
    Select[Prime[Range[2*10^5]],AllTrue[{2#-1,3#-2,(#+1)/2,(#+2)/3},PrimeQ]&] (* James C. McMahon, Jul 25 2025 *)
  • Python
    from gmpy2 import is_prime
    def ok(p): return p&1 and p%3 == 1 and all(is_prime(q) for q in [p, 2*p-1, 3*p-2, (p+1)//2, (p+2)//3])
    print([k for k in range(1, 10**7, 12) if ok(k)]) # Michael S. Branicky, Jul 25 2025