OFFSET
0,4
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10010
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
AUTHOR
Rémy Sigrist, May 01 2021
STATUS
approved