|
|
A336956
|
|
For any number n whose set of nonzero decimal digits is { d_0, ..., d_k } (with d_0 < ... < d_k), a(n) is obtained by replacing in the decimal representation of n each nonzero digit d_m by d_{k-m} for m = 0..k.
|
|
3
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 21, 31, 41, 51, 61, 71, 81, 91, 20, 12, 22, 32, 42, 52, 62, 72, 82, 92, 30, 13, 23, 33, 43, 53, 63, 73, 83, 93, 40, 14, 24, 34, 44, 54, 64, 74, 84, 94, 50, 15, 25, 35, 45, 55, 65, 75, 85, 95, 60, 16, 26, 36, 46, 56, 66, 76
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
This sequence is a self-inverse permutation of nonnegative integers.
This sequence first differs from A321474 for n = 112: a(112) = 221 whereas A321474(112) = 211.
This sequence has similarities with A166166; here we consider nonzero decimal digits, there binary run-lengths.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n iff n = 0 or n belongs to A125289.
|
|
EXAMPLE
|
For n = 10251:
- the set of nonzero digits is { 1, 2, 5},
- so we replace each digit 1, 2, 5 respectively by 5, 2, 1,
- and a(10251) = 50215.
|
|
PROG
|
(PARI) a(n, base=10) = { my (d=digits(n, base), s=Set(select(sign, d))); fromdigits(apply (t -> if (t, s[#s+1-setsearch (s, t)], 0), d), base) }
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|