login
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).
2
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,3
COMMENTS
This sequence is a permutation of the nonnegative integers (with inverse A343313):
- we can always extend the sequence with a member of A003462 sufficiently large,
- so the sequence is infinite and unbounded,
- once we have a k-digit number and before introducing a number with more than k digits, we must use A003462(k),
- so we have infinitely many terms of A003462 in this sequence,
- for any m with k digits, we have infinitely many terms of A003462 > m in the sequence, each of these terms can be followed by m, so m must eventually appear.
Apparently:
- the sequence preserves the number of digits in balanced ternary representation (A134021),
- fixed points correspond to 0 and A007051.
FORMULA
A343229(a(n)) AND A343228(a(n+1)) = A343228(a(n+1)) (where AND denotes the bitwise AND operator).
EXAMPLE
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
PROG
(PARI) See Links section.
CROSSREFS
Sequence in context: A093416 A073944 A072937 * A256640 A239466 A129509
KEYWORD
nonn,base,look
AUTHOR
Rémy Sigrist, Apr 11 2021
STATUS
approved