OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(6) = 4 because 6 is 110 in base 2 and 20 in base 3, which do not have nondecreasing digits, but 12 in base 4 has nondecreasing digits.
MAPLE
F:= proc(n) local k;
for k from 2 do if ListTools:-Sorted(convert(n, base, k), `>`) then return k fi od:
end proc:
map(f, [$1..1000]);
MATHEMATICA
Table[k = 2; While[Sort@ # != # &@ IntegerDigits[n, k], k++]; k, {n, 1, 120}] (* Michael De Vlieger, May 14 2016 *)
lk[n_]:=Module[{k=2}, While[Min[Differences[IntegerDigits[n, k]]]<0, k++]; k]; Array[lk, 90] (* Harvey P. Dale, May 24 2016 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, May 13 2016
STATUS
approved