Can negative integers be relatively prime? We know that if $\gcd(a,b)$ is equal to $1,$ then they are relatively prime.
However, I have seen all pairs $(a,b)$ as positive integers. My question is can any pair $(a,b)$ of negative integers be relatively prime?
For example, are $(-1,-1)$ and $(-18,-5)$ relatively prime?
 A: We may define relatively prime integers as follows.
Two integers are relatively prime if they do not have any common prime factors.
For example $5$ and $-12$ are relatively prime because the only  prime factor of $5$  is $5$ which is not a facotor of $-12$ whose prime factors are $2$ and $3$.
A: Given two integers $a$ and $b,$ we can obtain $\gcd(a, b) = d$ by running the Euclidean Algorithm. Explicitly, there exist integers $q_0$ and $r_0$ such that $a = bq_0 + r_0$ and $0 \leq r_0 \leq |b| - 1.$ Given that $r_0$ is nonzero, there exist integers $q_1$ and $r_1$ such that $b = r_0 q_1 + r_1$ and $0 \leq r_1 \leq r_0 - 1.$ Continuing in this way, there exists an integer $k$ such that $r_k \geq 1$ and $r_{k + 1} = 0$ by the Well-Ordering Principle. One can prove that $r_k = \gcd(a, b).$
Consequently, the greatest common divisor can be defined for any pair of integers $(a, b)$ regardless of their respective signs. We say that two integers $(a, b)$ are relatively prime whenever $\gcd(a, b) = 1,$ so again, this does not depend on the sign of $a$ and $b.$
