OFFSET
1,1
COMMENTS
This sequence of numbers is formed by positive integers k that make 6k-1, 6k+5, 6k+11 and 6k+17 prime numbers with no primes of the form 6k+1 in between. All prime numbers larger than 3 can be expressed as 6k-1 or 6k+1. Not all positive k make a prime number. Only certain k under certain conditions can make 6k-1 or 6k+1 prime.
All terms are == 2 (mod 5). - Robert G. Wilson v, Dec 14 2017
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
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.
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 *)
PROG
(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
(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
CROSSREFS
KEYWORD
nonn,hear
AUTHOR
Pedro Caceres, Dec 02 2017
STATUS
approved