OFFSET
0,3
COMMENTS
This sequence is the base 3 analog of A337304.
This sequence is a self-inverse permutation of the nonnegative integers.
LINKS
EXAMPLE
For n = 144:
- the ternary representation of 144 is "12100",
- the corresponding runs of consecutive equal digits are: "1", "2", "1", "00",
- there are five numbers k with the same multiset of runs:
k ter(k)
--- -------
86 "10012"
88 "10021"
136 "12001"
144 "12100"
190 "21001"
- so a(86) = 190,
a(88) = 144,
a(136) = 136,
a(144) = 88,
a(190) = 86.
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Aug 22 2020
STATUS
approved