login
Numbers k such that (2^k + k - 1)*2^k - 1 is prime.
7

%I #17 Apr 10 2023 10:50:42

%S 1,2,3,5,9,18,30,48,54,278,450,464,1425,1428,3029,7314,14273,15399,

%T 36962,50369

%N Numbers k such that (2^k + k - 1)*2^k - 1 is prime.

%e 3 is in the sequence because (2^3 + 3 - 1)*2^3 - 1 = 79 is prime.

%t lst={};Do[If[PrimeQ[(2^n + n-1)*2^n-1],AppendTo[lst,n]],{n,10000}];lst

%t Select[Range[7320],PrimeQ[(2^#+#-1)2^#-1]&] (* _Harvey P. Dale_, Feb 13 2021 *)

%o (Python)

%o from sympy import isprime

%o def afind(limit, startk=1):

%o pow2 = 2**startk

%o for k in range(startk, limit+1):

%o if isprime((pow2 + k - 1)*pow2 - 1):

%o print(k, end=", ")

%o pow2 *= 2

%o afind(1500) # _Michael S. Branicky_, Jan 12 2022

%Y Cf. A201356, A201357, A201358, A201360, A201361, A201362, A201363.

%K nonn,hard,more

%O 1,2

%A _Michel Lagneau_, Nov 30 2011

%E a(17)-a(18) from _Michael S. Branicky_, Jan 12 2022

%E a(19)-a(20) from _Michael S. Branicky_, Apr 10 2023