2
$\begingroup$

With $n\in \mathbb Z$, what values can $\gcd(n^2-n+1,n+2)$ take?

My attempt:

I have tried to solve the Diophantine equation: $$\gcd(n^2-n+1,n+2)=x(n^2-n+1)+y(n+2)$$ but, of course, for every value of $n$ there's an equation. The only thing I can calculate is the $\gcd$ of the two polynomials, but that seems to lead nowhere.

  • 3
    Hint: [Divide](https://en.wikipedia.org/wiki/Polynomial_long_division) one by the other.2017-02-06

2 Answers 2

3

Consider the fact that by synthetic division we have $$n^2-n+1=(n+2)(n-3)+7$$ Now use the Euclidean Algorithim. Note that $$\gcd(n^2-n+1, n+2)=\gcd(7, n+2)$$ So the possible values are $7$ and $1$. Putting in $n=5$ and $1$, we can see both of these values are possible.

The answer is thus both $7$ and $1$.

2

Well, if I just noodle about I get

$\gcd (n^2-n+1,n+2)=$

$\gcd (n^2-n+1-n (n+2),n+2)=$

$\gcd (-3n+1,n+2)=$

$\gcd (-3n+1+3 (n+2),n+2)=$

$\gcd (7,n+2) =$

$7$ if $n\equiv 5 \mod 7$

$1$ if $\not \equiv 5 \mod 7$

Unless I made an arithmetic error.