The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A242327 Primes p for which (p^n) + 2 is prime for n = 1, 3, 5, and 7. 2

%I #37 Apr 11 2020 06:02:37

%S 132749,1175411,3940799,5278571,11047709,12390251,15118769,21967241,

%T 22234871,26568929,31809959,32229341,32969591,35760551,38704661,

%U 43124831,43991081,49248971,50227211,51140861,53221631,55568171,59446109,63671651,71109161,76675589

%N Primes p for which (p^n) + 2 is prime for n = 1, 3, 5, and 7.

%C Subsequence of A001359 and A048637.

%H Abhiram R Devesh, <a href="/A242327/b242327.txt">Table of n, a(n) for n = 1..50</a>

%e p = 132749 (prime);

%e p + 2 = 132751 (prime);

%e p^3 + 2 = 2339342304585751 (prime);

%e p^5 + 2 = 41224584878413873150038751 (prime);

%e p^7 + 2 = 726471878470342746448722269536491751 (prime).

%o (Python)

%o import sympy

%o from sympy.ntheory import isprime, nextprime

%o n=2

%o while True:

%o n1=n+2

%o n2=n**3+2

%o n3=n**5+2

%o n4=n**7+2

%o ##.Check if n1, n2, n3 and n4 are also primes

%o if all(isprime(x) for x in [n1, n2, n3, n4]):

%o print(n, ", ", n1, ", ", n2, ", ", n3, ", ", n4)

%o n=nextprime(n)

%o (PARI) isok(p) = isprime(p) && isprime(p+2) && isprime(p^3+2) && isprime(p^5+2) && isprime(p^7+2); \\ _Michel Marcus_, May 15 2014

%o (Sage)

%o def is_A242327(n):

%o return is_prime(n) and all([is_prime(n^(2*k+1)+2) for k in range(4)])

%o filter(is_A242327, range(3940800)) # _Peter Luschny_, May 15 2014

%Y Cf. A001359, A006512, A048637.

%K nonn

%O 1,1

%A _Abhiram R Devesh_, May 10 2014

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 May 19 21:06 EDT 2024. Contains 372703 sequences. (Running on oeis4.)