A296011 Numbers n such that (6k-1) for k=n, n+1, n+2, n+3 are all primes with no primes of the form (6k+1) in between.
42, 897, 1052, 2107, 2242, 2457, 2632, 2912, 3887, 4362, 9347, 10367, 12587, 13132, 13797, 14072, 14897, 15737, 15877, 17452, 19292, 20092, 20167, 25677, 27042, 27307, 29967, 30842, 31227, 31837, 34337, 35742, 37052, 37772, 40587, 40957, 41672, 42147, 43687, 44192
Offset: 1
Examples
42 is in the sequence because 6*42-1=251, 6*43-1=257, 6*44-1=263, 6*45-1=296 are prime and there are no other primes in between, i.e., 6*42+1=253=11*23, 6*43+1=259=7*37, 6*44+1=265=5*53 are not primes.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Block[{nn = 50000, s}, s = Select[Prime@ Range@ PrimePi[6 (nn + 3) + 1], Divisible[(# - 1), 6] &]; Select[Range@ nn, And[AllTrue[#, PrimeQ], Count[s, q_ /; First[#] < q < Last@ #] == 0] &@ Map[6 # - 1 &, # + Range[0, 3]] &]] (* Michael De Vlieger, Dec 06 2017 *) fQ[n_] := Block[{p = {6n -1, 6n +5, 6n +11, 6n +17}}, Union@ PrimeQ@ p == {True} && NextPrime[6n -1, 3] == 6n +17]; Select[Range@50000, fQ] (* Robert G. Wilson v, Dec 14 2017 *)
-
PARI
isok(n) = isprime(6*n-1) && isprime(6*n+5) && isprime(6*n+11) && isprime(6*n+17) && ((primepi(6*n+17) - primepi(6*n-1)) == 3); \\ Michel Marcus, Dec 11 2017
-
Sage
a, b, c, d = 2, 3, 5, 7; R = [] for p in primes(10**5): if a % 6 + 1 == b - a == c - b == d - c == 6: R.append((a+1)//6) a, b, c, d = b, c, d, p R # Peter Luschny, Jan 08 2018
Comments