OFFSET
1,1
COMMENTS
A pair of cousin primes are primes of the form p and p+4 (where p+2 may or may not be a prime). - N. J. A. Sloane, Mar 18 2021
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Cousin Primes
FORMULA
MATHEMATICA
lst={}; Do[p=Prime[n]; If[PrimeQ[p4=p+4], (*Print[p4]; *)AppendTo[lst, p4]], {n, 10^2}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 21 2008 *)
Select[Prime[Range[300]], PrimeQ[#+4]&]+4 (* Harvey P. Dale, Dec 15 2017 *)
PROG
(PARI) forprime(p=2, 1e5, if(isprime(p-4), print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
(Haskell)
a046132 n = a046132_list !! (n-1)
a046132_list = filter ((== 1) . a010051') $ map (+ 4) a000040_list
-- Reinhard Zumkeller, Aug 01 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved