login
A112248
a(n) = n mod floor(log_2(n)).
3
0, 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4
OFFSET
2,7
COMMENTS
a(A112249(n)) = 0, a(A112250(n)) > 0, a(A112251(n)) = 1.
MAPLE
seq(seq(n mod d, n=2^d .. 2^(d+1)-1), d=1..8); # Robert Israel, Aug 27 2020
MATHEMATICA
Table[Mod[n, Floor @ Log2[n]], {n, 2, 100}] (* Amiram Eldar, Aug 27 2020 *)
PROG
(PARI) a(n) = n % logint(n, 2); \\ Michel Marcus, Aug 27 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Aug 30 2005
EXTENSIONS
Name edited by Michel Marcus, Aug 27 2020
STATUS
approved