What is the gcd of these two numbers? Is it possible to find the gcd? It should be $1$ when $n=1$, but $3$ when $n=5$.
$4n+1 = (3)(n+2) + (n-5)$ <-- This step is only valid when $n \geq 5$
How do I find the gcd?
What is the gcd of these two numbers? Is it possible to find the gcd? It should be $1$ when $n=1$, but $3$ when $n=5$.
$4n+1 = (3)(n+2) + (n-5)$ <-- This step is only valid when $n \geq 5$
How do I find the gcd?
On
The gcd divides $4n +1 - 4 (n+2) = -7$, so it can only be $1$ or $7$. If $7$ divides $n+2$, then $n \equiv -2 \pmod{7}$, so $4 n + 1 \equiv -8 + 1 \equiv 0 \pmod{7}$.
Thus the gdc is $7$ when $n \equiv -2 \pmod{7}$, and $1$ otherwise.
Hint $\ $ By Euclid $\,\gcd(n\!+\!2,4\color{#c00}n\!+\!1) = \gcd(n\!+\!2,\, 4(\color{#c00}{-2})\!+\!1)\,$ since $\ \color{#c00}{n\equiv -2}\pmod{\!n\!+\!2}$
Similarly we have $\ \gcd(n\!-\!a,f(n)) = \gcd(n\!-\!a,f(a))\ $ for any polynomial $f(x)$ with integer coef's which follows by employing the following congruence rule (follow the link for a proof).
Polynomial Congruence Rule $\ $ If $\,f(x)\,$ is polynomial with integer coefficients then $\ A\equiv a\ \Rightarrow\ f(A)\equiv f(a)\,\pmod m.$
Note how simple the proof is when viewed this way - it amounts to simple polynomial evaluation.
This is a prototypical example of the power of congruence arithmetic. It allows us to replace obscure manipulation of divisibility relations by simpler congruence operations and equations, which allows reuse of our well-honed intuition on analogous integer arithmetic. The common structure in both arithmetics is abstracted out when one goes on to study (quotient) rings.