login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A371267
Lexicographically latest sequence of distinct nonnegative integers such that the run lengths transforms of the balanced ternary expansions of n and of a(n) are the same.
2
0, 1, 3, 2, 4, 9, 10, 8, 7, 5, 6, 12, 11, 13, 27, 28, 26, 30, 31, 29, 25, 24, 23, 22, 21, 20, 16, 14, 15, 19, 17, 18, 36, 37, 35, 34, 32, 33, 39, 38, 40, 81, 82, 80, 84, 85, 83, 79, 78, 77, 90, 91, 89, 93, 94, 92, 88, 87, 86, 76, 75, 74, 73, 72, 71, 70, 69, 68
OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
FORMULA
A371263(a(n)) = A371263(n).
a(n) = n iff n belongs to A003462.
EXAMPLE
The first terms, in decimal and in balanced ternary, are:
n a(n) bter(n) bter(a(n))
-- ---- ------- ----------
0 0 0 0
1 1 1 1
2 3 1T 10
3 2 10 1T
4 4 11 11
5 9 1TT 100
6 10 1T0 101
7 8 1T1 10T
8 7 10T 1T1
9 5 100 1TT
10 6 101 1T0
11 12 11T 110
12 11 110 11T
13 13 111 111
14 27 1TTT 1000
15 28 1TT0 1001
PROG
(PARI) \\ See Links section.
CROSSREFS
See A371261 for a similar sequence.
Cf. A003462 (fixed points), A371263.
Sequence in context: A338243 A338246 A368225 * A374726 A084793 A033820
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 16 2024
STATUS
approved