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!)
A242517 List of primes p for which p^n - 2 is prime for n = 1, 3, and 5. 3
31, 619, 2791, 4801, 15331, 33829, 40129, 63421, 69151, 98731, 127291, 142789, 143569, 149971, 151849, 176599, 184969, 201829, 210601, 225289, 231841, 243589, 250951, 271279, 273271, 277549, 280591, 392269, 405439, 441799, 472711, 510709, 530599, 568441, 578689 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..250 from Abhiram R Devesh)
EXAMPLE
31 is in the sequence because
p = 31 (prime),
p - 2 = 29 (prime),
p^3 - 2 = 29789 (prime), and
p^5 - 2 = 28629149 (prime).
MATHEMATICA
Select[Range[600000], PrimeQ[#] && AllTrue[#^{1, 3, 5} - 2, PrimeQ] &] (* Amiram Eldar, Apr 06 2020 *)
PROG
(Python)
import sympy
n=2
while n>1:
....n1=n-2
....n2=((n**3)-2)
....n3=((n**5)-2)
....##Check if n1, n2 and n3 are also primes.
....if sympy.ntheory.isprime(n1)== True and sympy.ntheory.isprime(n2)== True and sympy.ntheory.isprime(n3)== True:
........print(n, " , " , n1, " , ", n2, " , ", n3)
....n=sympy.ntheory.nextprime(n)
(PARI) isok(p) = isprime(p) && isprime(p-2) && isprime(p^3-2) && isprime(p^5-2); \\ Michel Marcus, Apr 06 2020
(PARI) list(lim)=my(v=List(), p=29); forprime(q=31, lim, if(q-p==2 && isprime(q^3-2) && isprime(q^5-2), listput(v, q)); p=q); Vec(v) \\ Charles R Greathouse IV, Apr 06 2020
CROSSREFS
Intersection of A006512, A178251 and A154834, hence, intersection of A240126 and A154834.
Cf. A001359.
Sequence in context: A028142 A028148 A028100 * A028141 A302857 A028096
KEYWORD
nonn,easy
AUTHOR
Abhiram R Devesh, May 17 2014
STATUS
approved

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 March 28 20:05 EDT 2024. Contains 371254 sequences. (Running on oeis4.)