1

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 Answers4

1

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.

Bill Dubuque
  • 272,048
0

Hint: See what happens when n is even, and what happens when n is odd. :-)

Lucian
  • 48,334
  • 2
  • 83
  • 154
0

$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.$$

0

Hint:

$$ n^2 \equiv n \pmod 2 \implies n^2 - 3n - 1 \equiv n - 3n - 1 = -2n -1 \equiv 1 \pmod{2} $$