A173037 Numbers k such that k-4, k-2, k+2 and k+4 are prime.
9, 15, 105, 195, 825, 1485, 1875, 2085, 3255, 3465, 5655, 9435, 13005, 15645, 15735, 16065, 18045, 18915, 19425, 21015, 22275, 25305, 31725, 34845, 43785, 51345, 55335, 62985, 67215, 69495, 72225, 77265, 79695, 81045, 82725, 88815, 97845
Offset: 1
Keywords
Examples
9 is a term because 9-4 = 5 is prime, 9-2 = 7 is prime, 9+2 = 11 is prime and 9+4 = 13 is prime.
Links
- Klaus Brockhaus, Table of n, a(n) for n = 1..28388 (terms < 10^9).
Crossrefs
Programs
-
Magma
[ p+4: p in PrimesUpTo(100000) | IsPrime(p) and IsPrime(p+2) and IsPrime(p+6) and IsPrime(p+8) ]; // Klaus Brockhaus, Feb 09 2010
-
Mathematica
Select[Range[100000],AllTrue[#+{4,2,-2,-4},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 30 2015 *)
-
PARI
is(n)=isprime(n-4) && isprime(n-2) && isprime(n+2) && isprime(n+4) \\ Charles R Greathouse IV, Sep 24 2015
-
Python
from sympy import primerange def aupto(limit): p, q, r, alst = 2, 3, 5, [] for s in primerange(7, limit+5): if p+2 == q and p+6 == r and p+8 == s: alst.append(p+4) p, q, r = q, r, s return alst print(aupto(10**5)) # Michael S. Branicky, Feb 03 2022
Formula
For n >= 2, a(n) = 15*A112540(n-1). - Michel Marcus, May 19 2014
From Jeppe Stig Nielsen, Feb 18 2020: (Start)
For n >= 2, a(n) = 30*A014561(n-1) + 15.
For n >= 2, a(n) = 10*A007811(n-1) + 5.
a(n) = A007530(n) + 4.
a(n) = A125855(n) + 5. (End)
Extensions
Edited and extended beyond a(9) by Klaus Brockhaus, Feb 09 2010
Comments