login
Let k be the least positive number such that n AND floor(n/k) = 0 (where AND denotes the bitwise AND operator); a(n) = floor(n/k).
2

%I #8 Feb 05 2020 08:58:58

%S 0,0,1,0,2,2,1,0,4,4,5,0,3,2,1,0,8,8,9,4,10,10,1,0,6,6,5,4,3,2,1,0,16,

%T 16,17,8,18,18,9,0,20,20,21,4,3,2,1,0,12,12,12,12,10,10,9,0,7,6,5,4,3,

%U 2,1,0,32,32,33,16,34,34,17,8,36,36,37,4,19,2

%N Let k be the least positive number such that n AND floor(n/k) = 0 (where AND denotes the bitwise AND operator); a(n) = floor(n/k).

%H Rémy Sigrist, <a href="/A332011/b332011.txt">Table of n, a(n) for n = 0..8192</a>

%F a(n) = floor(n/A331985(n)).

%F Apparently, a(n) = 0 iff n = 0 or n belongs to A112714.

%e For n = 3:

%e - 3 AND floor(3/1) = 3,

%e - 3 AND floor(3/2) = 1,

%e - 3 AND floor(3/3) = 1,

%e - 3 AND floor(3/4) = 0,

%e - hence a(3) = floor(3/4) = 0.

%o (PARI) a(n) = for (k=1, oo, if (bitand(n, n\k)==0, return (n\k)))

%Y Cf. A112714, A331985.

%K nonn,base

%O 0,5

%A _Rémy Sigrist_, Feb 04 2020