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