A friend and I are in an intro to number theory class at UK and were struggling to prove the theorem that states that for two relatively prime integers $a$ and $b$ there exist integers x and y which satisfy the equation $ax+by=1$. We have now proven the theorem but while attempting to prove it began generating lists of relatively prime pairs with the same difference i.e. $(2,7)$, $(3,8)$, $(4,9)$..., and noticed patterns emerging in the solutions such as for differences of $5$:
(a,b) (x,y)
(2,7) (-3,1)
(3,8) (3,-1)
(4,9) (-2,1)
(6,10) (2,-1)
We are attempting to find a rule which will quickly generate a solution for any given pair, even of large numbers, not only for the differences of $5$ but for every given difference n. Any suggestions? Have you heard of this before?
Hint: Try extended Euclide algorithm and Bézout coefficients.