If we are on coordinate $(m,n)$ then we can either go to coordinate $(m + n, n)$ or $(m, m + n)$. If we start at $(2,5)$ then what all coordinates we can reach in finitely many moves?
In our case we have: From coordinate $(2,5)$ we can go to $(7,5)$ or $(2,7)$, now if you choose to go to $(7,5)$ then from $(7, 5)$ you can go to $(12,5)$ or $(7,12)$ and so on we keep on iterating this process and we need to find all such reachable coordinates. Any help would be highly appreciated. Thanks.
Given $(x,y)$, can it be reached? Clearly (or formally: by induction), $x,y$ must be integers and $x\ge 2$, $y\ge 5$. Also, we see (again formally: by induction) that $x\ne y$ because the allowed steps can only produce different coordinates $m+1\ne n$ or $m\ne m+n$ from positive $n,m$. Thus $(x,y)\ne(2,5)$ can be reached only via $(x-y,y)$ if $x>y$ and only via $(x,y-x)$ if $y>x$ and not at all if $x=y$.
Thus to check if $(x,y)$ can be reached, we only have to repeatedly go backwards and subtract the smaller from the larger coordinate and have won iff the last position before making $x<2$ or $y<5$ is $(2,5)$. Note that these steps are really just Euclid's algorithm in disguise, except that we stop a few steps before one coordinate becomes $0$ and the other the gcd. In particular, necessarily $\gcd(x,y)=\gcd(2,5)=1$. But this is not sufficient as many such pairs will rather go via points like $(3,7)$ for example.