login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Least positive number k such that 2^k mod k = 2n, or 0 if no such k exists.
2

%I #13 Jul 12 2015 20:35:36

%S 1,3,6,10669,9,18,3763,1010,20,35,2951,42,50,27,36,49,56,110,697,578,

%T 156,540923,70,287,104,147,4044,970,220,59378,119,345,66,3007,75,

%U 1990362,184,190,100,115,81,162,470,406,812,6631,105,310,160,207,322

%N Least positive number k such that 2^k mod k = 2n, or 0 if no such k exists.

%t lpn[n_]:=Module[{k=1},While[PowerMod[2,k,k]!=2n,k++];k]; Array[lpn,60,0] (* _Harvey P. Dale_, Jul 23 2012 *)

%Y A bisection of A036236: a(n) = A036236(2n).

%Y Cf. A124977.

%K nonn

%O 0,2

%A _N. J. A. Sloane_, May 11 2007, Jul 18 2008

%E New definition from _Benoit Jubin_, Jul 17 2008

%E More terms from _Max Alekseyev_, May 08 2009