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.
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
Examples
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
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..9841
- Rémy Sigrist, PARI program
- Index entries for sequences that are permutations of the natural numbers
Programs
-
PARI
\\ See Links section.
Comments