[go: up one dir, main page]

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!)
A242518 Primes p for which p^n - 2 is prime for n = 1, 3, 5 and 7. 2
201829, 2739721, 6108679, 7883329, 9260131, 9309721, 9917389, 14488249, 15386491, 15876481, 16685299, 16967191, 18145279, 20566969, 20869129, 21150991, 23194909, 25510189, 28406929, 34669909, 35039311, 36795169, 37912141, 39083521, 39805639 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
This is a subsequence of A242517.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..150 (first 100 terms from Abhiram R Davesh)
EXAMPLE
p = 201829 (prime)
p - 2 = 201827 (prime)
p^3 - 2 = 8221493263045787 (prime)
p^5 - 2 = 334902077869420623790640147 (prime)
p^7 - 2 = 13642217803107967058507788317851080907 (prime)
MATHEMATICA
Select[Prime[Range[25*10^5]], AllTrue[#^{1, 3, 5, 7}-2, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 26 2015 *)
PROG
(Python)
import sympy
n=2
while n>1:
....n1=n-2
....n2=((n**3)-2)
....n3=((n**5)-2)
....n4=((n**7)-2)
....##.Check if n1, n2, n3 and n4 are also primes
....if sympy.ntheory.isprime(n1)== True and sympy.ntheory.isprime(n2)== True and sympy.ntheory.isprime(n3)== True and sympy.ntheory.isprime(n4)== True:
........print(n, " , " , n1, " , ", n2, " , ", n3, " , ", n4)
....n=sympy.ntheory.nextprime(n)
CROSSREFS
Sequence in context: A252498 A355332 A274815 * A235929 A172623 A172728
KEYWORD
nonn
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 August 30 03:24 EDT 2024. Contains 375523 sequences. (Running on oeis4.)