Ma · Mathematics

Why Is gcd(k, n+k) = 1 Exactly When gcd(k, n) = 1?

Published By the 9to5Science editorial team

At a glance

  1. 1. Compare divisors

    A common divisor of k and n also divides n+k.

  2. 2. Reverse the argument

    A common divisor of k and n+k also divides their difference, n.

  3. 3. Conclude the identity

    The pairs have exactly the same common divisors, so their greatest common divisors are equal.

  4. 4. Apply coprimality

    The gcds are equal, so either one equals 1 exactly when the other does.

The statement follows from a basic fact about greatest common divisors: adding a multiple of one integer to another does not change the gcd. Here, the two pairs (k,n)(k,n) and (k,n+k)(k,n+k) have exactly the same common divisors, so their greatest common divisors are equal—not merely both equal to 11 in the coprime case.

Assume kk and nn are integers, and use the standard convention that a gcd is nonnegative. Under the common definition of gcd as the greatest positive common divisor, gcd⁡(0,0)\gcd(0,0) is undefined; some conventions instead define it as 00. We exclude k=n=0k=n=0 under the former convention.

Compare the common divisors

Let dd be a common divisor of kk and nn. Then d∣kd\mid k and d∣nd\mid n, so dd also divides their sum:

d∣n+k.d\mid n+k.

Thus every common divisor of kk and nn is also a common divisor of kk and n+kn+k.

Now reverse the reasoning. If d∣kd\mid k and d∣n+kd\mid n+k, then dd divides the difference:

d∣(n+k)−k=n.d\mid (n+k)-k=n.

So every common divisor of kk and n+kn+k is also a common divisor of kk and nn. The two pairs therefore have the same common divisors. In particular, they have the same greatest common divisor:

gcd⁡(k,n+k)=gcd⁡(k,n).\gcd(k,n+k)=\gcd(k,n).

Deduce the if-and-only-if statement

Two integers are relatively prime (or coprime) when their gcd is 11. Since the gcds above are equal, they are either both 11 or both different from 11. Hence

gcd⁡(k,n+k)=1⟺gcd⁡(k,n)=1.\gcd(k,n+k)=1\quad\Longleftrightarrow\quad\gcd(k,n)=1.

This proves both directions at once. If you want to spell them out separately:

  • If gcd⁡(k,n)=1\gcd(k,n)=1, then the gcd identity gives gcd⁡(k,n+k)=1\gcd(k,n+k)=1.
  • If gcd⁡(k,n+k)=1\gcd(k,n+k)=1, the same identity gives gcd⁡(k,n)=1\gcd(k,n)=1.

Worked example

Take k=12k=12 and n=18n=18. Then n+k=30n+k=30, and

gcd⁡(12,18)=6,gcd⁡(12,30)=6.\gcd(12,18)=6,\qquad \gcd(12,30)=6.

The common divisors are the same in both cases: 1,2,3,1,2,3, and 66. The gcd is not 11, so neither pair is coprime.

For a coprime example, take k=12k=12 and n=35n=35. Then n+k=47n+k=47. Since 1212 and 3535 have no common divisor greater than 11, the identity gives

gcd⁡(12,47)=gcd⁡(12,35)=1.\gcd(12,47)=\gcd(12,35)=1.

You can also check the first gcd directly: 47=3⋅12+1147=3\cdot12+11, 12=1⋅11+112=1\cdot11+1, so the Euclidean algorithm ends at 11.

A more general version

The same argument works when you add any integer multiple of one number to the other. For integers a,ba,b and qq,

gcd⁡(a,b+qa)=gcd⁡(a,b).\gcd(a,b+qa)=\gcd(a,b).

Indeed, a divisor of aa and bb divides b+qab+qa; conversely, a divisor of aa and b+qab+qa divides (b+qa)−qa=b(b+qa)-qa=b. This rule is one of the basic steps in the Euclidean algorithm, which repeatedly replaces a pair of numbers with a pair having the same gcd but smaller entries.

Common mistakes

  • Proving only one direction. Showing that common divisors of k,nk,n divide n+kn+k establishes only one inclusion. To prove the gcds are equal, also subtract kk from n+kn+k to recover nn.
  • Treating the claim as specific to gcd 11. The stronger result is gcd⁡(k,n+k)=gcd⁡(k,n)\gcd(k,n+k)=\gcd(k,n), regardless of whether that gcd is 11.
  • Assuming positivity is essential. The divisibility argument works for negative integers and for zero as well, as long as the gcd is defined. For example, gcd⁡(0,n)=gcd⁡(0,n+0)=∣n∣\gcd(0,n)=\gcd(0,n+0)=|n| when n≠0n\ne0.
  • Ignoring the undefined pair. Under the convention that gcd⁡(0,0)\gcd(0,0) is undefined, if k=n=0k=n=0, both gcd expressions are undefined, so the stated numerical equality is not applied. Under a convention assigning gcd⁡(0,0)=0\gcd(0,0)=0, the equality also holds for that pair.

The key idea is that addition and subtraction preserve the set of common divisors when the same term is present in both numbers.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.