login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A343836
Array T(n, k), n, k > 0, read by antidiagonals; the balanced ternary representation of T(n, k) is obtained by adding componentwise (i.e., without carries) the digits in the balanced ternary representations of n and of k.
1
0, 1, 1, 2, -1, 2, 3, 3, 3, 3, 4, 4, -2, 4, 4, 5, 2, -4, -4, 2, 5, 6, 6, -3, -3, -3, 6, 6, 7, 7, 10, -2, -2, 10, 7, 7, 8, 5, 8, 8, -4, 8, 8, 5, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 13, 10, 10, -5, 10, 10, 13, 10, 10, 11, 8, 11, 11, 8, -7, -7, 8, 11, 11, 8, 11
OFFSET
0,4
COMMENTS
This sequence is similar to A003987 and to A004489.
We use the following table to combine individual digits (this is the balanced ternary addition table read mod 3):
| T 0 1
---+-------
T | 1 T 0
0 | T 0 1
1 | 0 1 T
LINKS
Rémy Sigrist, Colored representation of the table for n, k < 1094 (blue denotes negative values, red denotes positive values, dark colors correspond to small values in absolute value)
FORMULA
T(n, k) = T(k, n).
T(m, T(n, k)) = T(T(m, n), k).
T(n, 0) = n.
T(n, n) = -n.
EXAMPLE
Array T(n, k) begins:
n\k| 0 1 2 3 4 5 6 7 8 9 10 11 12 13
---+-----------------------------------------------------------------
0| 0 1 2 3 4 5 6 7 8 9 10 11 12 13
1| 1 -1 3 4 2 6 7 5 9 10 8 12 13 11
2| 2 3 -2 -4 -3 10 8 9 13 11 12 7 5 6
3| 3 4 -4 -3 -2 8 9 10 11 12 13 5 6 7
4| 4 2 -3 -2 -4 9 10 8 12 13 11 6 7 5
5| 5 6 10 8 9 -5 -7 -6 -11 -13 -12 -8 -10 -9
6| 6 7 8 9 10 -7 -6 -5 -13 -12 -11 -10 -9 -8
7| 7 5 9 10 8 -6 -5 -7 -12 -11 -13 -9 -8 -10
8| 8 9 13 11 12 -11 -13 -12 -8 -10 -9 -5 -7 -6
9| 9 10 11 12 13 -13 -12 -11 -10 -9 -8 -7 -6 -5
10| 10 8 12 13 11 -12 -11 -13 -9 -8 -10 -6 -5 -7
11| 11 12 7 5 6 -8 -10 -9 -5 -7 -6 -11 -13 -12
12| 12 13 5 6 7 -10 -9 -8 -7 -6 -5 -13 -12 -11
13| 13 11 6 7 5 -9 -8 -10 -6 -5 -7 -12 -11 -13
Array T(n, k) begins in balanced ternary:
n\k| 0 1 1T 10 11 1TT 1T0 1T1 10T 100 101 11T 110 111
---+----------------------------------------------------------------------
0| 0 1 1T 10 11 1TT 1T0 1T1 10T 100 101 11T 110 111
1| 1 T 10 11 1T 1T0 1T1 1TT 100 101 10T 110 111 11T
1T| 1T 10 T1 TT T0 101 10T 100 111 11T 110 1T1 1TT 1T0
10| 10 11 TT T0 T1 10T 100 101 11T 110 111 1TT 1T0 1T1
11| 11 1T T0 T1 TT 100 101 10T 110 111 11T 1T0 1T1 1TT
1TT| 1TT 1T0 101 10T 100 T11 T1T T10 TT1 TTT TT0 T01 T0T T00
1T0| 1T0 1T1 10T 100 101 T1T T10 T11 TTT TT0 TT1 T0T T00 T01
1T1| 1T1 1TT 100 101 10T T10 T11 T1T TT0 TT1 TTT T00 T01 T0T
10T| 10T 100 111 11T 110 TT1 TTT TT0 T01 T0T T00 T11 T1T T10
100| 100 101 11T 110 111 TTT TT0 TT1 T0T T00 T01 T1T T10 T11
101| 101 10T 110 111 11T TT0 TT1 TTT T00 T01 T0T T10 T11 T1T
11T| 11T 110 1T1 1TT 1T0 T01 T0T T00 T11 T1T T10 TT1 TTT TT0
110| 110 111 1TT 1T0 1T1 T0T T00 T01 T1T T10 T11 TTT TT0 TT1
111| 111 11T 1T0 1T1 1TT T00 T01 T0T T10 T11 T1T TT0 TT1 TTT
PROG
(PARI) T(n, k, c=v->centerlift(Mod(v, 3))) = { if (n==0 && k==0, return (0), my (d=c(n), t=c(k)); c(d+t)+3*T((n-d)/3, (k-t)/3)) }
CROSSREFS
KEYWORD
sign,tabl,base
AUTHOR
Rémy Sigrist, May 01 2021
STATUS
approved