OFFSET
0,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
FORMULA
7 is 111_2 (has 1), 21_3 (has 2), 13_4 (has 3), but 12_5 (no 4), so a(7)=5.
PROG
(Haskell)
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
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Franklin T. Adams-Watters, May 15 2006
STATUS
approved