login
A119352
Smallest base b > 1 such that n in base b uses no digit b-1.
4
2, 3, 4, 3, 3, 4, 4, 5, 4, 3, 3, 5, 3, 3, 6, 5, 4, 4, 4, 6, 4, 4, 4, 7, 4, 4, 4, 3, 3, 7, 3, 3, 4, 4, 4, 5, 3, 3, 4, 3, 3, 4, 4, 5, 6, 6, 6, 9, 6, 6, 5, 5, 5, 5, 6, 5, 5, 5, 5, 7, 5, 5, 5, 5, 4, 4, 4, 5, 4, 4, 4, 7, 4, 4, 4, 5, 5, 5, 5, 6, 4, 3, 3, 5, 3, 3, 4, 5, 4, 4, 3, 3, 5, 3, 3, 9, 4, 4, 4, 6, 4, 4, 4, 7, 4
OFFSET
0,1
LINKS
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
STATUS
approved