|
|
A338831
|
|
a(n) is the greatest number not yet in the sequence with the same number of digits and the same smallest digit as n.
|
|
2
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 90, 91, 81, 71, 61, 51, 41, 31, 21, 19, 80, 18, 92, 82, 72, 62, 52, 42, 32, 29, 70, 17, 28, 93, 83, 73, 63, 53, 43, 39, 60, 16, 27, 38, 94, 84, 74, 64, 54, 49, 50, 15, 26, 37, 48, 95, 85, 75, 65, 59, 40, 14, 25, 36, 47, 58, 96, 86
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
This sequence is a self-inverse permutation of the nonnegative integers.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For n = 77:
- the numbers with 2 digits and smallest digit 7 are: 77, 78, 79, 87 and 97,
- so a(77) = 97,
a(78) = 87,
a(79) = 79,
a(87) = 78,
a(97) = 77.
|
|
MATHEMATICA
|
Block[{a = {}, f, k}, f[x_] := Min@ IntegerDigits@ x; Do[k = f[i]; AppendTo[a, SelectFirst[Range[10^# - 1, 10^(# - 1), -1] &@ Floor[1 + Log10[i]], And[f[#] == k, FreeQ[a, #]] &]], {i, 67}]; a] (* Michael De Vlieger, Nov 13 2020 *)
|
|
PROG
|
(PARI) See Links section.
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|