login
A223475
Least k such that the decimal representation of k*n has digits in nonincreasing order.
2
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 3, 2, 2, 3, 3, 4, 1, 1, 1, 4, 3, 2, 2, 2, 3, 3, 1, 1, 1, 1, 13, 2, 2, 2, 2, 17, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 15, 13, 9, 9, 1, 1, 1, 1, 1, 1, 1, 13, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 84, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 86, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 5, 7, 5, 2, 5, 3, 4, 6, 1, 1, 75, 47, 38, 8, 45, 56, 8, 7, 5, 55, 5, 7
OFFSET
1,12
LINKS
EXAMPLE
39*17 = 663 has digits in nonincreasing order, and no k < 17 has this property, hence a(39) = 17.
MATHEMATICA
a[n_] := a[nn_] := Block[{n = nn, f, w = Range@9, k = 1}, While[Mod[n, 10] == 0, n /= 10]; While[(f = Select[w, Max@ Differences@ IntegerDigits[n*#] <= 0 &, 1]) == {}, k++; w = Union@ Flatten@Table[ Select[d*10^(k-1) + w, Max@ Differences@ IntegerDigits[Mod[n*#, 10^k], 10, k] <= 0 &], {d, 0, 9}]]; f[[1]]]; Array[a, 123] (* faster than basic approach. Giovanni Resta, Mar 26 2013 *)
CROSSREFS
a(n)*n yields sequence A223474.
Cf. A009996.
Sequence in context: A276373 A317173 A190302 * A190137 A003561 A201327
KEYWORD
nonn,base
AUTHOR
Paul Tek, Mar 20 2013
STATUS
approved