cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A273040 Least k >= 2 such that the base-k digits of n are nondecreasing.

Original entry on oeis.org

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

Views

Author

Robert Israel, May 13 2016

Keywords

Comments

a(n) = 2 iff n is in A000225.
a(n) = 3 iff n is in A023745 but not A000225.
a(n) <= floor(n/2)-1 if n > 9.

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.
		

Crossrefs

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 *)