login
A353662
The binary expansions of A352909(n+1, 1) and A352909(n+1, 2) encode respectively the 1's and the -1's in the balanced ternary expansion of a(n).
3
0, -1, 1, -3, 3, -4, -2, 2, 4, -9, 9, -10, -8, 8, 10, -12, -6, 6, 12, -13, -11, -7, -5, 5, 7, 11, 13, -27, 27, -28, -26, 26, 28, -30, -24, 24, 30, -31, -29, -25, -23, 23, 25, 29, 31, -36, -18, 18, 36, -37, -35, -19, -17, 17, 19, 35, 37, -39, -33, -21, -15, 15
OFFSET
0,4
COMMENTS
This sequence is a permutation from the nonnegative integers onto the integers (Z).
LINKS
FORMULA
a(n) = A005836(A352909(n+1, 1)) - A005836(A352909(n+1, 2)).
a(n) = A117966(A353660(n)).
Sum_{k = 0..n} a(k) = 0 iff n = 0 or n belongs to A074330.
EXAMPLE
For n = 42:
- A352909(43, 1) = 9,
- A352909(43, 2) = 2,
- the binary expansion of 9 is "1001",
- the binary expansion of 2 is "10",
- so the balanced ternary expansion of a(42) is "10T1",
- and a(42) = 25.
PROG
(PARI) b2t(n) = fromdigits(binary(n), 3)
{ n=-1; for (d=0, 2^8-1, for (k=0, d, if (bitand(t1=k, t2=d-k)==0, print1 (b2t(t1) - b2t(t2)", "); if (n++==61, break (2))))) }
CROSSREFS
KEYWORD
sign,base
AUTHOR
Rémy Sigrist, May 02 2022
STATUS
approved