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.

A243780 Primes p for which p^i + 4 is prime for i = 1, 3 and 5.

This page as a plain text file.
%I A243780 #30 May 22 2025 10:21:38
%S A243780 7,5503,8779,14629,15877,21013,23599,51199,61483,70237,78163,79333,
%T A243780 80149,96667,113089,113359,133153,140053,149377,150889,184039,198967,
%U A243780 228199,251287,255637,295843,301123,303613,356929,382843,385393,393709,420037,457363,458119
%N A243780 Primes p for which p^i + 4 is prime for i = 1, 3 and 5.
%C A243780 This is a subsequence of:
%C A243780 A023200: Primes p such that p + 4 is also prime.
%C A243780 A243583: Primes p for which p + 4 and p^3 + 4 are prime.
%H A243780 Amiram Eldar, <a href="/A243780/b243780.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..250 from Abhiram R Devesh)
%e A243780 p=7 is in this sequence as p + 4, p^3 + 4, p^5 + 4 (11, 347, 16811) are all prime.
%e A243780 p=5503 is in this sequence as p + 4 = 5507 (prime), p^3 + 4 = 166647398531 (prime) and p^5 + 4 = 5046584669419727747 (prime).
%t A243780 Select[Range[500000], PrimeQ[#] && AllTrue[#^{1, 3, 5} + 4, PrimeQ] &] (* _Amiram Eldar_, Apr 04 2020 *)
%o A243780 (Python)
%o A243780 import sympy.ntheory as snt
%o A243780 n=2
%o A243780 while n>1:
%o A243780     n1=n+4
%o A243780     n2=((n**3)+4)
%o A243780     n3=((n**5)+4)
%o A243780     ##Check if n1 , n2 and n3 are also primes.
%o A243780     if snt.isprime(n1)== True and snt.isprime(n2)== True and snt.isprime(n3)== True:
%o A243780         print(n,n1,n2,n3)
%o A243780     n=snt.nextprime(n)
%o A243780 (PARI) s=[]; forprime(p=2, 200000, if(isprime(p+4) && isprime(p^3+4) && isprime(p^5+4), s=concat(s, p))); s \\ _Colin Barker_, Jun 11 2014
%Y A243780 Cf. A023200, A243583.
%K A243780 nonn,easy
%O A243780 1,1
%A A243780 _Abhiram R Devesh_, Jun 10 2014