A103318 Number of solutions i in range [0,n-1] to i == 0 mod 2^(n-i).
1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 1, 2, 2, 2, 1, 2, 2, 3, 2, 3, 2, 2, 1, 2, 2, 3, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 1, 2, 2, 2, 1, 2, 2, 3, 2, 3, 3, 2, 1, 2, 2, 3, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 1, 2, 2, 2, 1, 2, 2, 3
Offset: 1
Keywords
Examples
For n = 11 solutions are i = 0, 8 and 10. Four solutions occur for the first time at n = 2059: they are i = 0, 2048, 2056, 2058. Five solutions occur for the first time at n = 2^2059 + 2059 (see A034797).
Links
Programs
-
Maple
f:= proc (n) local t1, l; t1 := 0; for l to n do if `mod`(n-l,2^l) = 0 then t1 := t1+1 end if end do; t1 end proc;
-
Mathematica
f[n_] := Block[{c = 1, k = Max[1, n - Floor[ Log[2, n] + 2]]}, While[k < n, If[ Mod[k, 2^(n - k)] == 0, c++ ]; k++ ]; c]; Table[ f[n], {n, 105}] (* Robert G. Wilson v, Mar 21 2005 *)
Formula
a(n) = A104234(2^n - n). - Philippe Deléham, Apr 21 2005
Comments