login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A271982 Primes p such that p + 42 is also prime. 5

%I #13 Feb 14 2017 02:35:54

%S 5,11,17,19,29,31,37,41,47,59,61,67,71,89,97,107,109,131,137,139,149,

%T 151,157,181,191,197,199,227,229,239,241,251,269,271,307,311,317,331,

%U 337,347,359,367,379,389,397,401,419,421,449,457,461

%N Primes p such that p + 42 is also prime.

%C A134120 is a subsequence of this sequence.

%H Karl V. Keller, Jr., <a href="/A271982/b271982.txt">Table of n, a(n) for n = 1..10000</a>

%e 5 is a term because 5 + 42 = 47 is also prime.

%e 11 is a term because 11 + 42 = 53 is also prime.

%p A271982:=n->`if`(isprime(n) and isprime(n+42), n, NULL): seq(A271982(n), n=1..10^3); # _Wesley Ivan Hurt_, Feb 12 2017

%t Select[Prime@ Range@ 90, PrimeQ[# + 42] &] (* _Michael De Vlieger_, Apr 18 2016 *)

%o (Python)

%o from sympy import isprime

%o for i in range(3,2001,2):

%o ..if isprime(i) and isprime(i+42): print (i,end=', ')

%o (PARI) lista(nn) = forprime(p=2, nn, if (isprime(p+42), print1(p, ", "))); \\ _Michel Marcus_, Apr 19 2016

%Y Cf. A000040, A134120.

%K nonn

%O 1,1

%A _Karl V. Keller, Jr._, Apr 17 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 29 20:26 EDT 2024. Contains 373855 sequences. (Running on oeis4.)