A106370 Smallest b > 1 such that n contains no zeros in its base b representation.
2, 3, 2, 3, 3, 4, 2, 3, 4, 4, 4, 5, 3, 3, 2, 3, 3, 5, 5, 6, 4, 3, 3, 5, 3, 3, 4, 6, 4, 4, 2, 5, 5, 5, 6, 5, 4, 4, 4, 3, 3, 4, 3, 3, 4, 4, 4, 5, 3, 3, 6, 3, 3, 4, 4, 5, 4, 4, 4, 7, 4, 4, 2, 5, 6, 5, 3, 3, 5, 3, 3, 5, 5, 5, 7, 3, 3, 7, 3, 3, 5, 5, 5, 5, 4, 4, 4, 5, 4, 4, 4, 5, 4, 4, 4, 5, 5, 5, 5, 6, 4, 4, 4, 6, 4
Offset: 1
Examples
n = 20: 20[binary] = '101001', 20[ternary] = '202', 20[base-4] = '110', 20[base-5] = '40', all containing at least one zero, but: 20[base-6] = '32', containing no zero therefore a(20) = 6.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a106370 n = f 2 n where f b x = g x where g 0 = b g z = if r == 0 then f (b + 1) n else g z' where (z', r) = divMod z b -- Reinhard Zumkeller, Apr 12 2015
-
Mathematica
a[n_] := Module[{b = 2}, While[MemberQ[IntegerDigits[n, b], 0], b++]; b]; Array[a, 100] (* Amiram Eldar, Jul 29 2025 *)
Formula
Extensions
Typo in comment fixed by Reinhard Zumkeller, Aug 06 2010