A343312 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, the digits "-1" in the balanced ternary representation of a(n) correspond to digits "+1" in that of a(n+1).
0, 1, 2, 4, 3, 5, 13, 6, 11, 7, 12, 8, 10, 9, 14, 40, 15, 38, 16, 39, 17, 34, 20, 37, 18, 32, 22, 33, 21, 35, 19, 36, 23, 31, 24, 29, 25, 30, 26, 28, 27, 41, 121, 42, 119, 43, 120, 44, 115, 47, 118, 45, 113, 49, 114, 48, 116, 46, 117, 50, 103, 59, 112, 51, 101
Offset: 0
Examples
The first terms, alongside their balanced ternary representation (with "T" instead of digits "-1"), are: n a(n) bter(a(a)) -- ---- ---------- 0 0 0 1 1 1 2 2 1T 3 4 11 4 3 10 5 5 1TT 6 13 111 7 6 1T0 8 11 11T 9 7 1T1 10 12 110 11 8 10T 12 10 101 13 9 100 14 14 1TTT 15 40 1111 16 15 1TT0 17 38 111T
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..9842
- Rémy Sigrist, Scatterplot of the sequence for n = 0..3^9
- Rémy Sigrist, PARI program for A343312
- Index entries for sequences that are permutations of the natural numbers
Programs
-
PARI
See Links section.
Comments