My brute force algorithm is as follows:
Given X and Y positive integers < 2^30-1
while true
If X == Y
Terminate fail
If Y > X
swap X,Y
If (X,Y) found in Q
Terminate success
Add (X,Y) to Q
X -= Y
Y += Y
My brute force algorithm works, but on large numbers it takes a loooong time to complete. I'm assuming there is some sort of algorithm for this but my math is not good enough to know what that algorithm is. In other words, I don't know what question to ask.
Just looking for a pointer to the algorithm, if it exists.
Some examples 1,2 Terminates true in a loop as sub 1 gets 1 and the add gets 2 so you have 1,2 again
$1,3$ terminates false as $1,3 \rightarrow 2,2$
$1,7$ terminates false as $1,7 \rightarrow 2, 6 \rightarrow 4,4$
I'm looking for a shortcut instead of doing the full brute force chasing down the potential chain.