A diophantine equation related to primes.

71 Views Asked by At

I have $2$ prime numbers $p_1$ and $p_2$. I have to find the solution of $\large{p_1t_1+p_2t_2=1}$ where $t_1$ and $t_2$ are integers. How do I do this?

1

There are 1 best solutions below

0
On BEST ANSWER

This can be done using the extended Euclidean algorithm, which gives an $x$ and $y$ solving

$$p_1 x + p_2 y = \text{gcd}(p_1, p_2) = 1$$