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.

A247348 Primes p such that (p-k)/(k+1) is also prime for k = 1, 2, 3, 4.

Original entry on oeis.org

174599, 334319, 535919, 671039, 907199, 2129399, 2298119, 3103799, 3369959, 4351199, 4598159, 5697599, 6184799, 6446159, 7224839, 7943759, 7957319, 8148839, 8346959, 8656919, 9096359, 9339119, 9463319, 9511199, 10514159, 10780559, 11816999, 12424319, 13781039
Offset: 1

Views

Author

Keywords

Comments

Could be called 4-safe primes, or safe primes of order 4, as the safe primes are the primes such that (p-1)/2 is prime.
Obviously a subsequence of the k-safe primes for k < 4 : A005385 (safe primes, k=1), A181841 (supersafe primes, k=2), A247347 (k=3).
a(n) = 119 (mod 120) for all n.
These numbers generate sequences 5-4-3-2-1 in A052126.

Crossrefs

Cf. A005385 (safe primes), A181841 (supersafe primes), A247347 (3-safe primes), A163573 (similar definition with (p+k)/(k+1) as primes).

Programs

  • Mathematica
    lst={}; Do[p=Prime[n]; If[PrimeQ[(p-1)/2]&&PrimeQ[(p-2)/3]&&PrimeQ[(p-3)/4]&&PrimeQ[(p-4)/5], AppendTo[lst, p]], {n, 2*9!}]; lst
    Select[Prime[Range[900000]],AllTrue[Table[(#-k)/(k+1),{k,4}],PrimeQ]&] (* Harvey P. Dale, Jul 07 2025 *)
  • PARI
    isokp(v) = (type(v) == "t_INT") && isprime(v);
    lista(nn) = {forprime(p=2, nn, if (isokp((p-1)/2) && isokp((p-2)/3) && isokp((p-3)/4) && isokp((p-4)/5), print1(p, ", ")););} \\ Michel Marcus, Sep 15 2014
    
  • Python
    from _future_ import division
    from sympy import prime, isprime
    A247348_list = [p for p in (5*prime(n)+4 for n in range(1,10**6)) if not ((p-1) % 2 or (p-2) % 3 or (p-3) % 4) and isprime(p) and isprime((p-1)//2) and isprime((p-2)//3) and isprime((p-3)//4)] # Chai Wah Wu, Sep 18 2014

Extensions

More terms from Michel Marcus, Sep 15 2014