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.

A240710 Primes p such that at least one number among p+-6 and p+-12 is also a prime.

This page as a plain text file.
%I A240710 #15 Feb 21 2022 11:33:36
%S A240710 5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,
%T A240710 101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,
%U A240710 191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,541,547,557,563
%N A240710 Primes p such that at least one number among p+-6 and p+-12 is also a prime.
%C A240710 The first difference between a(n) and A000040(n+2) is a(97) = 541, while A000040(99) = prime(99) = 523.
%C A240710 The union of A240709 and A240710 is the set of all prime numbers, i.e., A000040.
%H A240710 Lei Zhou, <a href="/A240710/b240710.txt">Table of n, a(n) for n = 1..10000</a>
%e A240710 For 2, 2+-6 and 2+-12 are all even composite numbers. So 2 is excluded.
%e A240710 For 3, 3+-6 and 3+-12 are all multiples of 3. So 3 is excluded.
%e A240710 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 included.
%e A240710 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 excluded.
%t A240710 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, 100}]
%t A240710 Select[Prime[Range[3,150]],AnyTrue[#+{-12,-6,6,12},PrimeQ]&] (* _Harvey P. Dale_, Feb 21 2022 *)
%Y A240710 Cf. A000040, A240709.
%K A240710 nonn,easy
%O A240710 1,1
%A A240710 _Lei Zhou_, Apr 10 2014