OFFSET
1,1
COMMENTS
All terms are primes == 5 modulo 6 (A005384 Sophie Germain primes).
a(8) >= 500000. - Max Alekseyev, May 28 2022
EXAMPLE
n = 11, 2^n -1 = 2047 = 23*89,
n = 23, 8388607 = 47*178481,
n = 131, 2722258935367507707706996859454145691647 = 263*10350794431055162386718619237468234569.
MATHEMATICA
Select[Range[4000], PrimeQ[2*# + 1] && PowerMod[2, #, 2*# + 1] == 1 &&
PrimeQ[(2^# - 1)/(2*# + 1)] &] (* Giovanni Resta, Mar 23 2014 *)
PROG
(PARI) is(n)=n%6==5 && Mod(2, 2*n+1)^n==1 && isprime(2*n+1) && ispseudoprime((2^n-1)/(2*n+1)) \\ Charles R Greathouse IV, Aug 25 2016
(Python)
from sympy import isprime, nextprime
A239638_list, p = [], 5
while p < 10**6:
if (p % 6) == 5:
n = (p-1)//2
if pow(2, n, p) == 1 and isprime((2**n-1)//p):
A239638_list.append(n)
p = nextprime(p) # Chai Wah Wu, Jun 05 2019
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Zak Seidov, Mar 23 2014
EXTENSIONS
a(5)-a(6) from Giovanni Resta, Mar 23 2014
a(7) from Eric Chen, added by Max Alekseyev, May 21 2022
STATUS
approved