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.

A087679 Numbers k such that both k+2 and k-2 are prime.

This page as a plain text file.
%I A087679 #35 Feb 16 2025 08:32:51
%S A087679 5,9,15,21,39,45,69,81,99,105,111,129,165,195,225,231,279,309,315,351,
%T A087679 381,399,441,459,465,489,501,615,645,675,741,759,771,825,855,861,879,
%U A087679 885,909,939,969,1011,1089,1095,1215,1281,1299,1305,1425,1431,1449,1485
%N A087679 Numbers k such that both k+2 and k-2 are prime.
%C A087679 Essentially the same as A029708: a(n) = A029708(n-1) for n>=2.
%C A087679 Midpoint of cousin prime pairs.
%C A087679 The only prime is 5. All other terms are multiples of 3. - _Zak Seidov_, May 19 2014
%H A087679 M. F. Hasler, <a href="/A087679/b087679.txt">Table of n, a(n) for n = 1..1000</a>
%H A087679 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CousinPrimes.html">Cousin Primes</a>
%F A087679 a(n) = (A023200(n) + A046132(n))/2 = A023200(n) + 2 = A046132(n) - 2.
%F A087679 a(n+1) = A056956(n)*6 + 3 = A157834(n)*3; a(n) = A088762(n)*2 + 1. - _M. F. Hasler_, Apr 05 2017
%p A087679 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
%t A087679 lst={};Do[If[PrimeQ[n-2]&&PrimeQ[n+2],AppendTo[lst,n]],{n,3,8!,2}];lst (* _Vladimir Joseph Stephan Orlovsky_, Jan 14 2009 *)
%o A087679 (PARI) s=[]; for(n=1, 2000, if(isprime(n-2) && isprime(n+2), s=concat(s, n))); s \\ _Colin Barker_, May 19 2014
%o A087679 (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
%Y A087679 Cf. A014574, A087678-A087683, A087695-A087697, A088762.
%K A087679 nonn,easy
%O A087679 1,1
%A A087679 _Zak Seidov_, Sep 27 2003
%E A087679 More terms from _Ray Chandler_, Oct 26 2003