<s>[INST] If $a_n=1+n+n^2$ how do you compute the $gcd(a_n+1,a_{n+s})$ 
Question: If $n$ is a positive number I write $a(n) =1+n+n^2$. Let $s$
  be a fixed positive number. Is it true the $\gcd(a_n+1, a_{n+s})$ will be a
  divisor of $1+5s^2+s^4$?

For example if $n=1$ and $s=3$ then $\gcd(4,21)=1$ which is a divisor of $1+5*3^2+3^4=127$, since $1 |127$. On the other hand if $n=106$ then $\gcd(10922,11557)=127$ and $127 |127$. 
 [/INST] $g = \gcd(a_n + 1, a_{n+s}) \\= \gcd(n^2 + n + 2, (n+s)^2 + (n+s) + 1) \\= \gcd(n^2 + n + 2, s^2 + 2ns + s - 1)$
So if we have $u \cdot (n^2 + n + 2) + v \cdot (s^2 + 2ns + s - 1) = g$, we can apply the Extended Euclidean Algorithm for polynomials to get:
$(\frac{4s^2}{s^4+5s^2+1}) \cdot (n^2 + n + 2) + (\frac{s^2-2ns-s-1}{s^4+5s^2+1}) \cdot (s^2 + 2ns + s - 1) = 1$
Multiply to flatten the expression:
$(4s^2) \cdot (n^2 + n + 2) + (s^2-2ns-s-1) \cdot (s^2 + 2ns + s - 1) = s^4+5s^2+1$
This means $\gcd(a_n + 1, a_{n+s})$ must divide $s^4+5s^2+1$, so the answer to your question is yes.
</s>