A243269 Smallest prime p such that p^k - 2 is prime for all odd exponents k from 1 up to 2*n-1 (inclusive).
5, 19, 31, 201829, 131681731, 954667531, 8998333416049
Offset: 1
Examples
For n = 1, p = 5, p - 2 = 3 is prime. For n = 2, p = 19, p - 2 = 17 and p^3 - 2 = 6857 are primes. For n = 3, p = 31, p - 2 = 29, p^3 - 2 = 29789, and p^5 - 2 = 28629149 are primes.
Programs
-
Python
import sympy ## isp_list returns an array of true/false for prime number test for a ## list of numbers def isp_list(ls): pt=[] for a in ls: if sympy.ntheory.isprime(a)==True: pt.append(True) return(pt) co=1 while co < 7: al=0 n=2 while al!=co: d=[] for i in range(0, co): d.append(int(n**((2*i)+1))-2) al=isp_list(d).count(True) if al==co: ## Prints prime number and its corresponding sequence d print(n, d) n=sympy.ntheory.nextprime(n) co=co+1
Extensions
a(7) from Bert Dobbelaere, Aug 30 2020
Comments