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.

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

This page as a plain text file.
%I A243818 #22 May 22 2025 10:21:38
%S A243818 11,971,1877,2861,8741,12641,13163,16763,28283,29021,30707,36713,
%T A243818 41957,42227,58967,98717,105971,115127,128663,138641,160817,164093,
%U A243818 167441,190763,205607,210173,211067,228341,234197,237977,246473,249107,276557,295433,312233
%N A243818 Primes p for which p^i - 4 is prime for i = 1, 3 and 5.
%C A243818 This is a subsequence of the following:
%C A243818 A046132: Larger member p+4 of cousin primes (p, p+4).
%C A243818 A243817: Primes p for which p - 4 and p^3 - 4 are primes.
%H A243818 Amiram Eldar, <a href="/A243818/b243818.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..250 from Abhiram R Devesh)
%e A243818 p = 11 is in this sequence because p - 4 = 7  (prime), p^3 - 4 = 1327 (prime) and p^5 - 4 = 161047 (prime).
%e A243818 p = 971 is in this sequence because p - 4 = 967  (prime), p^3 - 4 = 915498607 (prime) and p^5 - 4 = 863169625893847 (prime).
%t A243818 Select[Range[300000], PrimeQ[#] && AllTrue[#^{1, 3, 5} - 4, PrimeQ] &] (* _Amiram Eldar_, Apr 04 2020 *)
%t A243818 Select[Prime[Range[27000]],AllTrue[#^{1,3,5}-4,PrimeQ]&] (* _Harvey P. Dale_, Jan 04 2021 *)
%o A243818 (Python)
%o A243818 import sympy.ntheory as snt
%o A243818 n=5
%o A243818 while n>1:
%o A243818     n1=n-4
%o A243818     n2=((n**3)-4)
%o A243818     n3=((n**5)-4)
%o A243818     ##Check if n1 , n2 and n3 are also primes.
%o A243818     if snt.isprime(n1)== True and snt.isprime(n2)== True and snt.isprime(n3)== True:
%o A243818         print(n, n1, n2, n3)
%o A243818     n=snt.nextprime(n)
%Y A243818 Cf. A046132, A243817.
%K A243818 nonn,easy
%O A243818 1,1
%A A243818 _Abhiram R Devesh_, Jun 11 2014