Iterative function eventually reaching identity

82 Views Asked by At

For integers $a,b$ we define $f((a,b))=(2a,b-a)$ if $a<b$ and $f((a,b))=(a-b,2b)$ if $a\geq b$. Given a natural number $n>1$ show that there exist natural numbers $m,k$ with $m<n$ such that $f^{k}((n,m))=(m,n)$,where $f^{k}(x)=f(f(f(...f(x))))$,$f$ being composed with itself $k$ times. Also, is there an explicit form of $k$ using $m,n$? If yes, then find it or prove otherwise.

This is a problem from the Indian Team Selection Test for IMO. I was trying this one, but I have no idea about it. I can only see that the sum of the variables remain constant, i.e $a+b=2a+(b-a)=2b+(a-b)$. But how to use this fact? And I also couldn't guess what could be the length. The expressions seem to point towards $\gcd$ but I have no proof. Can someone help me? Thanks.