OFFSET
0,2
COMMENTS
(a,b,T(a,b)) are the winning positions in 3-pile Wythoff game. A move in k-pile Wythoff is: pick a subset of the k piles and remove the same number of stones from each. Goal: take the last stone.
T(a,b) = T(b,a). If T(a,b)=c then T(a,c)=b and T(b,c)=a.
EXAMPLE
0 2 1 5 7 ...
2 4 0 3 1 ...
1 0 6 8 10 ...
5 3 8 1 4 ...
7 1 10 4 3 ...
T(1,1)=4, since from (114) your opponent can move to (113),(112),(111),(110),(014),(013),(004),(003). You can either win or move to (012) and win a move later.
MATHEMATICA
mex[ s_ ] := Min[ Complement[ Range[ 0, Max[ {s, -1} ]+1 ], Flatten[ s ] ] ]; f[ s_ ] := Join[ s, s+Table[ i, {i, Length[ s ]} ] ]; T[ a_, b_ ] := T[ a, b ] = mex[ { f[ Table[ T[ a-i, b ], {i, a} ] ], f[ Table[ T[ a, b-i ], {i, b} ] ], f[ Table[ T[ a-i, b-i ], {i, Min[ a, b ]} ] ] } ]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
EXTENSIONS
Edited and extended by Christian G. Bower, Oct 29 2002
STATUS
approved