login
A343230
A binary encoding of the digits "0" in balanced ternary representation of n.
4
0, 0, 0, 1, 0, 0, 1, 0, 2, 3, 2, 0, 1, 0, 0, 1, 0, 2, 3, 2, 0, 1, 0, 4, 5, 4, 6, 7, 6, 4, 5, 4, 0, 1, 0, 2, 3, 2, 0, 1, 0, 0, 1, 0, 2, 3, 2, 0, 1, 0, 4, 5, 4, 6, 7, 6, 4, 5, 4, 0, 1, 0, 2, 3, 2, 0, 1, 0, 8, 9, 8, 10, 11, 10, 8, 9, 8, 12, 13, 12, 14, 15, 14, 12
OFFSET
0,9
COMMENTS
The ones in the binary representation of a(n) correspond to the nonleading digits "0" in the balanced ternary representation of n.
We can extend this sequence to negative indices: a(-n) = a(n) for any n >= 0.
LINKS
EXAMPLE
The first terms, alongside the balanced ternary representation of n (with "T" instead of digits "-1") and the binary representation of a(n), are:
n a(n) ter(n) bin(a(n))
-- ---- ------ ---------
0 0 0 0
1 0 1 0
2 0 1T 0
3 1 10 1
4 0 11 0
5 0 1TT 0
6 1 1T0 1
7 0 1T1 0
8 2 10T 10
9 3 100 11
10 2 101 10
11 0 11T 0
12 1 110 1
13 0 111 0
14 0 1TTT 0
15 1 1TT0 1
PROG
(PARI) a(n) = { my (v=0, b=1, t); while (n, t=centerlift(Mod(n, 3)); if (t==0, v+=b); n=(n-t)\3; b*=2); v }
CROSSREFS
Cf. A059095, A140267, A291770, A343228, A343229, A343231, A147991 (indices of 0's).
Sequence in context: A291293 A259572 A027413 * A019509 A071484 A372706
KEYWORD
nonn,look,base
AUTHOR
Rémy Sigrist, Apr 08 2021
STATUS
approved