login
A321767
Reverse runs of nonzero digits in ternary expansion of n and convert back to decimal.
1
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 12, 13, 14, 15, 16, 17, 18, 11, 20, 21, 22, 23, 24, 25, 26, 27, 28, 55, 30, 37, 46, 57, 64, 73, 36, 31, 58, 39, 40, 41, 42, 43, 44, 45, 32, 59, 48, 49, 50, 51, 52, 53, 54, 29, 56, 33, 38, 47, 60, 65, 74, 63, 34, 61, 66, 67
OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of nonnegative integers.
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
See A321726 for a similar sequence.
Sequence in context: A032906 A349484 A075905 * A207506 A343131 A119246
KEYWORD
nonn,base,look
AUTHOR
Rémy Sigrist, Nov 18 2018
STATUS
approved