OFFSET
1,1
LINKS
Lei Zhou, Table of n, a(n) for n = 1..10000
EXAMPLE
For 2, 2+-6 and 2+-12 are all even numbers and composite. So 2 is included.
For 3, 3+-6 and 3+-12 are all multiples of 3. So 3 is included.
For each prime number p between 5 and 521, at least one number among p+-6 and p+-12 is a prime number, thus p is excluded.
For 523, 523 - 12 = 511 = 7*73, 523 - 6 = 517 = 11*47, 523 + 6 = 529 = 23^2, 523 + 12 = 535 = 5*107. They are all composites. So 523 is included.
MATHEMATICA
p = 1; Table[While[p = NextPrime[p]; ok = 0; a1 = p - 12; a2 = p - 6; a3 = p + 6; a4 = p + 12; If[a1 > 0, If[PrimeQ[a1], ok = 1]]; If[a2 > 0, If[PrimeQ[a2], ok = 1]]; If[PrimeQ[a3], ok = 1]; If[PrimeQ[a4], ok = 1]; ok != 0]; p, {n, 1, 46}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lei Zhou, Apr 10 2014
STATUS
approved