OFFSET
0,3
COMMENTS
The b that produces the smallest value is always the smallest b such that n in base b does not use b-1.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
EXAMPLE
10 = 101_3, 101_2 = 5, so a(10) = 5.
11 = 102_3, which has a 2; 11 = 23_4, which has a 3; 11 = 21_5, 21_4 = 9, so a(11) = 9.
PROG
(PARI) a(n) = for (b=3, oo, my (d=digits(n, b)); if (#d==0 || vecmax(d) < b-1, return (fromdigits(d, b-1)))) \\ Rémy Sigrist, May 07 2018
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Franklin T. Adams-Watters, May 15 2006
STATUS
approved