A371261 Lexicographically latest sequence of distinct nonnegative integers such that the run lengths transforms of the ternary expansions of n and of a(n) are the same.
0, 2, 1, 7, 8, 6, 5, 3, 4, 22, 23, 21, 25, 26, 24, 20, 19, 18, 17, 16, 15, 11, 9, 10, 14, 12, 13, 67, 68, 66, 70, 71, 69, 65, 64, 63, 76, 77, 75, 79, 80, 78, 74, 73, 72, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 35, 34, 33, 29, 27
Offset: 0
Examples
The first terms, in decimal and in base 3, are: n a(n) ter(n) ter(a(n)) -- ---- ------ --------- 0 0 0 0 1 2 1 2 2 1 2 1 3 7 10 21 4 8 11 22 5 6 12 20 6 5 20 12 7 3 21 10 8 4 22 11 9 22 100 211 10 23 101 212 11 21 102 210 12 25 110 221 13 26 111 222 14 24 112 220 15 20 120 202
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..6560
- Rémy Sigrist, PARI program
- Index entries for sequences that are permutations of the natural numbers
Programs
-
PARI
\\ See Links section.
Comments