A279209 Length of first run of 0's in binary expansion of n.
1, 0, 1, 0, 2, 1, 1, 0, 3, 2, 1, 1, 2, 1, 1, 0, 4, 3, 2, 2, 1, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 0, 5, 4, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 4, 3, 2, 2, 1, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 0, 6, 5, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0
Examples
4 = 100_2 so a(4) = 2.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
Table[First[Map[Length, DeleteCases[Split@IntegerDigits[n, 2], w_/;Times@@w>0]]/.{}->{0}], {n, 0, 200}] (* Vincenzo Librandi, Dec 23 2016 *) (* after Michael De Vlieger *)