Problem
NT-B1-M02-P008 Numbers Two Apart
#8
★★☆☆☆ Level 2 of 5
Prove that \(\gcd(n,n+2)\) divides \(2\). Determine this GCD for even and odd \(n\).
A common divisor divides the difference \(2\).
Let \(d=\gcd(n,n+2)\). Then \(d\mid(n+2)-n=2\), so \(d\in\{1,2\}\). If \(n\) is even, both numbers are even and the GCD is \(2\). If \(n\) is odd, both numbers are odd, so they do not share the divisor \(2\), and the GCD is \(1\).
A simple example where the GCD depends on the parity of the parameter.