This is an equivalent description of “Wythoff’s Game”. But you don’t actually need to know fancy theory to solve the problem. At first generate some grundy value form smaller numbers. Then find a pattern. The pattern is very hard to find but you will be amazed to see that the pattern is related to golden ratio.