A273040 Least k >= 2 such that the base-k digits of n are nondecreasing.
2, 3, 2, 3, 3, 4, 2, 3, 5, 4, 4, 5, 3, 3, 2, 6, 3, 5, 5, 7, 4, 4, 4, 5, 7, 3, 4, 6, 6, 8, 2, 5, 5, 5, 6, 8, 5, 5, 5, 3, 3, 4, 4, 3, 6, 6, 4, 7, 5, 6, 6, 6, 3, 8, 8, 10, 6, 6, 6, 7, 7, 5, 2, 5, 6, 7, 7, 5, 5, 9, 6, 11, 7, 5, 7, 7, 8, 8, 8, 3, 7, 7, 7, 8, 4
Offset: 1
Examples
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.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
Comments