login
A342115
Lexicographically latest sequence of distinct nonnegative integers such that the multisets of frequencies of digits in the decimal representations of n and of a(n) are the same.
2
0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 98, 99, 97, 96, 95, 94, 93, 92, 91, 90, 89, 87, 88, 86, 85, 84, 83, 82, 81, 80, 79, 78, 76, 77, 75, 74, 73, 72, 71, 70, 69, 68, 67, 65, 66, 64, 63, 62, 61, 60, 59, 58, 57, 56, 54, 55, 53, 52, 51, 50, 49, 48, 47, 46, 45, 43, 44, 42
OFFSET
0,2
COMMENTS
We ignore leading zeros (hence a(0) = 0).
This sequence is a self-inverse permutation of the nonnegative integers.
FORMULA
a(d * (10^k-1)/9) = (10-d) * (10^k-1)/9 for any k >= 0 and d = 1..9.
a(n) < 10^k for any n < 10^k.
EXAMPLE
Consider the set of numbers T with two distinct digits, say u and v, such that u appears once and v appears twice:
- the least elements of T are: 100, 101, 110, 112,
- the greatest elements of T are: 995, 996, 997, 998,
- so a(100) = 998, a(101) = 997, a(110) = 996, a(112) = 995.
PROG
(PARI) See Links section.
CROSSREFS
See A342102 for similar sequences.
Sequence in context: A298372 A089186 A055120 * A090671 A132673 A363249
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 28 2021
STATUS
approved