OFFSET
0,2
LINKS
Alois P. Heinz, Antidiagonals n = 0..200, flattened
Rémy Sigrist, Colored representation of the table for 0 <= n, k < 3^7 (where the hue is function of T(n, k))
Wikipedia, Set (game)
FORMULA
A(n,k) = A(floor(n/3),floor(k/3))*3+(6-(n mod 3)-(k mod 3) mod 3), A(0,0) = 0.
EXAMPLE
Square array A(n,k) begins:
0, 2, 1, 6, 8, 7, 3, 5, 4, ...
2, 1, 0, 8, 7, 6, 5, 4, 3, ...
1, 0, 2, 7, 6, 8, 4, 3, 5, ...
6, 8, 7, 3, 5, 4, 0, 2, 1, ...
8, 7, 6, 5, 4, 3, 2, 1, 0, ...
7, 6, 8, 4, 3, 5, 1, 0, 2, ...
3, 5, 4, 0, 2, 1, 6, 8, 7, ...
5, 4, 3, 2, 1, 0, 8, 7, 6, ...
4, 3, 5, 1, 0, 2, 7, 6, 8, ...
MAPLE
A:= proc(n, k) local i, j; `if`(n=0 and k=0, 0,
A(iquo(n, 3, 'i'), iquo(k, 3, 'j'))*3 +irem(6-i-j, 3))
end:
seq(seq(A(n, d-n), n=0..d), d=0..14);
CROSSREFS
AUTHOR
Alois P. Heinz, Jan 04 2015
STATUS
approved