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”).

A087679
Numbers k such that both k+2 and k-2 are prime.
20
5, 9, 15, 21, 39, 45, 69, 81, 99, 105, 111, 129, 165, 195, 225, 231, 279, 309, 315, 351, 381, 399, 441, 459, 465, 489, 501, 615, 645, 675, 741, 759, 771, 825, 855, 861, 879, 885, 909, 939, 969, 1011, 1089, 1095, 1215, 1281, 1299, 1305, 1425, 1431, 1449, 1485
OFFSET
1,1
COMMENTS
Essentially the same as A029708: a(n) = A029708(n-1) for n>=2.
Midpoint of cousin prime pairs.
The only prime is 5. All other terms are multiples of 3. - Zak Seidov, May 19 2014
LINKS
Eric Weisstein's World of Mathematics, Cousin Primes
FORMULA
a(n) = (A023200(n) + A046132(n))/2 = A023200(n) + 2 = A046132(n) - 2.
a(n+1) = A056956(n)*6 + 3 = A157834(n)*3; a(n) = A088762(n)*2 + 1. - M. F. Hasler, Apr 05 2017
MAPLE
ZL:=[]:for p from 1 to 1485 do if (isprime(p) and isprime(p+4) ) then ZL:=[op(ZL), (p+(p+4))/2]; fi; od; print(ZL); # Zerinvary Lajos, Mar 07 2007
MATHEMATICA
lst={}; Do[If[PrimeQ[n-2]&&PrimeQ[n+2], AppendTo[lst, n]], {n, 3, 8!, 2}]; lst (* Vladimir Joseph Stephan Orlovsky, Jan 14 2009 *)
PROG
(PARI) s=[]; for(n=1, 2000, if(isprime(n-2) && isprime(n+2), s=concat(s, n))); s \\ Colin Barker, May 19 2014
(PARI) is_A087679(n)={isprime(n-2) && isprime(n+2)} \\ For numbers >> 10^12 one should add conditions {n%6==3 && ... || n==5} or consider only such numbers congruent to 3 (mod 6). - M. F. Hasler, Apr 05 2017
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Sep 27 2003
EXTENSIONS
More terms from Ray Chandler, Oct 26 2003
STATUS
approved