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).
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
Examples
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.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..6560
Programs
-
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))))) }
Comments