OFFSET
0,2
COMMENTS
Number of integers k which require exactly n steps to reach 0, when starting from k and iterating the map: x -> x - (number of runs in binary representation of x).
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..16143
FORMULA
EXAMPLE
0 is the only number reached from 0 in zero steps, thus a(0) = 1.
Both 1 and 2, in binary '1' and '10', when the number of runs (A005811) is subtracted from them, result zero: 1-1 = 2-2 = 0, and these are only such numbers where the zero is reached with one step, thus a(1) = 2.
For 3, 4 and 5, in binary '11', '100' and '101', subtracting the number of runs results 2 in all cases, thus two steps are requires to reach zero, and as there are no other such cases, a(2) = 3.
For 6, in binary '110', subtracting A005811 repeatedly gives -> 6-2 = 4, 4-2 = 2, 2-2 = 0, three steps in total, and as 6 is the only such number requiring three steps, a(3) = 1.
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 14 2015
STATUS
approved