OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of nonnegative integers.
LINKS
FORMULA
a(3 * n) = 3 * a(n).
EXAMPLE
For n = 11111:
- the ternary representation of 11111 is "120020112",
- we have three runs of nonzero digits: "12", "2" and "112",
- we replace the first by the third, the third by the first and the second remains in place,
- the result is: "112002012",
- and a(11111) = 10265.
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Nov 18 2018
STATUS
approved