Find the greatest common divisor (gcd) of $n^2 - 3n - 1$ and $2$ considering that $n$ is an integer. Thanks.
-
$2$ is prime, so it can either be $1$ or $2$ and $n$ can either be even or odd. What is $n^2 - 3n = n(n-3)$? – k.stm Mar 09 '14 at 21:58
4 Answers
Hint $\ $ One of $\,\ n,\,\ n\!-\!3\,$ is even so $\ n(n\!-\!3)-1\,$ is odd, so coprime to $\,2.$
Alternatively $\,2\nmid f(n)=n^2-3n-1\,$ since $f$ has no roots mod $\,2\!:\ f(0)\equiv 1\equiv f(1),\,$ which is a special case of the Parity Root Test.

- 272,048
$2$ only has two divisors, 0 and 1. So $gcd(a,2)=1$ or $2, \forall a \in \mathbb{Z}$.
Case 1: $n$ is even. Then $n^2 \equiv 0 \pmod{2}, 3n\equiv 0 \pmod{2}.$ So then $gcd(n^2-3n-1,2)=1$ because $n^2-3n-1 \equiv 0+0-1 \equiv 1 \pmod{2}$.
Case 2: $n$ is odd. Then $n^2 \equiv 1 \pmod{2}, 3n \equiv 1 \pmod{2}.$ So then $gcd(n^2-3n-1,2)=1$ again because $n^2-3n-1 \equiv 1+1-1 \equiv 1 \pmod{2}$.
$$\therefore \forall n \in \mathbb{Z}, gcd(n^2-3n-1,2)=1.$$
Alternatively, by Fermat's Little Theorem, $a^2 \equiv a \pmod{2},$ so$$ n^2-3n-1 \equiv n-3n-1 \equiv -2n-1 \equiv 1 \pmod{2} \implies gcd(n^2-3n-1,2)=1.$$

- 2,369
-
You mean 2 and 1?How can zero be a divisor when dividing by zero is not defined? – kingW3 Mar 09 '14 at 22:08
-
Hint:
$$ n^2 \equiv n \pmod 2 \implies n^2 - 3n - 1 \equiv n - 3n - 1 = -2n -1 \equiv 1 \pmod{2} $$

- 45,895