We may assume that a, b, c are all positive, since if a, b, c are all positive, and gcd(a+kb,c)=gcd(a,b,c) for some integer k, then we immediately have gcd(−a+(−k)b,±c)=gcd(−a+k(−b),±c)=gcd(a+(−k)(−b),±c)=gcd(±a,±b,±c). Moreover, if at least one of a, b and c is equal to 1, then the result follows immediately: if a=1 or c=1, choose k=0; otherwise, if b=1, choose k=1−a. In all these cases, gcd(a+kb,c)=gcd(a,b,c)=1.
Henceforth, assume that all of a, b and c are greater than 1. This implies that there is a list of prime numbers p1,p2,…,pn and non-negative integers αi,βi,γi, i=1,2,…,n, such that
a=p1α1p2α2⋯pnαn
b=p1β1p2β2⋯pnβn
c=p1γ1p2γ2⋯pnγn.
Let us first assume that gcd(a,b,c)=1. This implies that, for each i∈{1,2,…,n}, not all three of αi,βi and γi are positive. We may also assume that, for each i∈{1,2,…,n}, not all three of αi,βi and γi are 0 (otherwise we could simply discard the primes pi for which this happens). We now call a prime pi a *one-prime* if exactly one of αi,βi and γi is positive. Likewise, we call a prime pi a *two-prime* if exactly two of αi,βi and γi are positive. Let E={pi1,pi2,…,pit} be the complete list of one-primes among p1,p2,…,pn. If there are no one-primes in this list, put E=∅. Let
k={pi1pi2⋯pit1if E=∅if E=∅.
We show that, for this k, gcd(a+kb,c)=gcd(a,b,c)=1.
Since gcd(a+kb,c) is a divisor of c, the only possible way that gcd(a+kb,c)>1 is that it is divisible by at least one of p1,p2,…,pn. We show that this is not the case.
Firstly, consider any pij∈E (if E=∅). For the triple (αij,βij,γij) there are three possibilities:
I. (αij,βij,γij)=(αij,0,0), with αij>0. Here, pij does not divide c.
II. (αij,βij,γij)=(0,βij,0), with βij>0. Here, again, pij does not divide c.
III. (αij,βij,γij)=(0,0,γij), with γij>0. Here, pij does not divide a+kb (where k=pi1pi2⋯pit).
So gcd(a+kb,c) is not divisible by any of the one-primes.
Secondly, let pr denote any of the two-primes. For the triple (αr,βr,γr) there are three possibilities:
I'. (αr,βr,γr)=(αr,βr,0), with αr,βr>0. Here, pr does not divide c.
II'. (αr,βr,γr)=(αr,0,γr), with αr,γr>0. Here, pr does not divide a+kb (recall that k is not divisible by pr).
III'. (αr,βr,γr)=(0,βr,γr), with βr,γr>0. Here, again, pr does not divide a+kb.
It follows that gcd(a+kb,c)=1=gcd(a,b,c).
Finally, if gcd(a,b,c)=d>1, then gcd(da,db,dc)=1, and from the above, there exists an integer k such that gcd(da+k⋅db,dc)=1=gcd(da,db,dc). Multiplying both sides by d gives gcd(a+kb,c)=d=gcd(a,b,c), and we are done.