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.

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

This page as a plain text file.
%I A242327 #37 Apr 11 2020 06:02:37
%S A242327 132749,1175411,3940799,5278571,11047709,12390251,15118769,21967241,
%T A242327 22234871,26568929,31809959,32229341,32969591,35760551,38704661,
%U A242327 43124831,43991081,49248971,50227211,51140861,53221631,55568171,59446109,63671651,71109161,76675589
%N A242327 Primes p for which (p^n) + 2 is prime for n = 1, 3, 5, and 7.
%C A242327 Subsequence of A001359 and A048637.
%H A242327 Abhiram R Devesh, <a href="/A242327/b242327.txt">Table of n, a(n) for n = 1..50</a>
%e A242327 p = 132749 (prime);
%e A242327 p + 2 = 132751 (prime);
%e A242327 p^3 + 2 = 2339342304585751 (prime);
%e A242327 p^5 + 2 = 41224584878413873150038751 (prime);
%e A242327 p^7 + 2 = 726471878470342746448722269536491751 (prime).
%o A242327 (Python)
%o A242327 import sympy
%o A242327 from sympy.ntheory import isprime, nextprime
%o A242327 n=2
%o A242327 while True:
%o A242327     n1=n+2
%o A242327     n2=n**3+2
%o A242327     n3=n**5+2
%o A242327     n4=n**7+2
%o A242327     ##.Check if n1, n2, n3 and n4 are also primes
%o A242327     if all(isprime(x) for x in [n1, n2, n3, n4]):
%o A242327         print(n, ", ", n1, ", ", n2, ", ", n3, ", ", n4)
%o A242327     n=nextprime(n)
%o A242327 (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 A242327 (Sage)
%o A242327 def is_A242327(n):
%o A242327     return is_prime(n) and all([is_prime(n^(2*k+1)+2) for k in range(4)])
%o A242327 filter(is_A242327, range(3940800)) # _Peter Luschny_, May 15 2014
%Y A242327 Cf. A001359, A006512, A048637.
%K A242327 nonn
%O A242327 1,1
%A A242327 _Abhiram R Devesh_, May 10 2014