Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 5000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
7 is 111_2 (has 1), 21_3 (has 2), 13_4 (has 3), but 12_5 (no 4), so a(7)=5.
a119352 n = f 2 n where
f b x = g x where
g 0 = b
g z = if r == b - 1 then f (b + 1) n else g z'
where (z', r) = divMod z b
-- Reinhard Zumkeller, Apr 12 2015
Cf. A119353, A119354, A106370.
Sequence in context: A274007 A065870 A123699 * A205010 A204932 A079086
Adjacent sequences: A119349 A119350 A119351 * A119353 A119354 A119355
Franklin T. Adams-Watters, May 15 2006