login
A283756
Smallest prime p such that q = 2*p^(2*n + 1) - 1 and r = 2*q^(2*n + 1) - 1 are also prime.
1
2, 523, 1531, 2731, 12781, 785503, 1439089, 372901, 1678459, 3418531, 2986689, 62651791, 24463189, 11887633, 14486959, 144025633, 5546251, 55402591, 50246569, 896263, 64925929, 110217193, 130868911, 206925703, 93252169, 201500821, 15370051, 352151431, 465719869, 246405823, 1397904439, 441472981, 662770291, 233944933, 426610519
OFFSET
0,1
EXAMPLE
2*2^(2*0 + 1) - 1 = 3 prime, 2*3^(2*0 + 1) - 1 = 5 so a(0)=2.
MATHEMATICA
a[n_] := Block[{p=2, m=2*n+1, q}, While[! PrimeQ[q = 2*p^m-1] || ! PrimeQ[ 2*q^m-1], p = NextPrime@ p]; p]; a /@ Range[0, 7] (* Giovanni Resta, Mar 19 2017 *)
PROG
(PARI) a(n) = my(p=2); while (! isprime(q=2*p^(2*n + 1) - 1) || !isprime(2*q^(2*n + 1) - 1), p = nextprime(p+1)); p; \\ Michel Marcus, Mar 18 2017
(Python)
from sympy import isprime, nextprime
def A283756(n):
....p=2
....m=2*n + 1
....while True:
........q=2*p**m - 1
........if (not isprime(q) or not isprime(2*q**m - 1)): p = nextprime(p)
........else: break
....return p # Indranil Ghosh, Mar 19 2017
CROSSREFS
Sequence in context: A080778 A007513 A352852 * A352803 A071613 A332152
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 16 2017
STATUS
approved