A239638 Numbers n such that the semiprime 2^n-1 is divisible by 2n+1.
11, 23, 83, 131, 3359, 130439, 406583
Offset: 1
Examples
n = 11, 2^n -1 = 2047 = 23*89, n = 23, 8388607 = 47*178481, n = 131, 2722258935367507707706996859454145691647 = 263*10350794431055162386718619237468234569.
Programs
-
Mathematica
Select[Range[4000], PrimeQ[2*# + 1] && PowerMod[2, #, 2*# + 1] == 1 && PrimeQ[(2^# - 1)/(2*# + 1)] &] (* Giovanni Resta, Mar 23 2014 *)
-
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
Extensions
a(5)-a(6) from Giovanni Resta, Mar 23 2014
a(7) from Eric Chen, added by Max Alekseyev, May 21 2022
Comments