login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A231332
Primes p = prime(k) such that p - 2k and p + 2k are prime.
1
17, 23, 37, 89, 113, 151, 307, 463, 557, 643, 701, 761, 863, 911, 977, 1019, 1069, 1093, 1427, 1481, 1733, 1867, 2521, 2687, 2731, 2753, 3163, 3221, 3581, 3623, 3877, 4139, 4243, 4621, 4643, 4783, 4861, 4889, 4937, 5443, 5569, 5807, 5903, 6619, 6701, 6761, 6871
OFFSET
1,1
COMMENTS
Corresponding values of k: 7, 9, 12, 24, 30, 36, 63, 90, 102, 117, 126, 135, 150. All except the first one, 7, are multiples of 3.
EXAMPLE
17 is the seventh prime, and 17 - 2 * 7 = 3 and 17 + 2 * 7 = 31, both of which are prime, so 17 is in the sequence.
23 is the ninth prime, and 23 - 2 * 9 = 5 and 23 + 2 * 9 = 41, both of which are prime, so 23 is in the sequence.
29 is the tenth prime, and 29 - 2 * 10 = 9 and 29 + 2 * 10 = 49, neither of which is prime, so 29 is not in the sequence.
MATHEMATICA
Reap[Sow[17]; Do[p = Prime[k]; If[PrimeQ[p + 2 * k] && PrimeQ[p - 2 * k], Sow[p]], {k, 9, 10^3, 3}]][[2, 1]]
Select[Table[{n, Prime[n]}, {n, 1000}], AllTrue[#[[2]]+{2#[[1]], -2#[[1]]}, PrimeQ]&][[All, 2]] (* Harvey P. Dale, Aug 05 2022 *)
PROG
(PARI){print(17", "); forstep(k=9, 885, 3, p=prime(k); if(isprime(p+2*k)&& isprime(p-2*k), print(p", ")))}
(PARI) k=0; forprime(p=2, 1e6, k++; if(isprime(p-2*k) && isprime(2+2*k), print1(p", "))) \\ Charles R Greathouse IV, Jan 07 2014
CROSSREFS
Intersection of A231232 and A231326. Cf. A000040, A231506, A014689
Sequence in context: A333327 A241528 A156567 * A243137 A256397 A139843
KEYWORD
nonn
AUTHOR
Zak Seidov, Jan 07 2014
STATUS
approved