<s>[INST] Proving $\gcd(n^2(n^2+1),2n+1)=\gcd(2n+1,5)$ We suppose $\forall n \in \mathbb {N}\setminus{0}$.
How can I prove that $\gcd(n^2(n^2+1),2n+1)=\gcd(2n+1,5)$?
 [/INST] \begin{align}
(2n+1)^4 - 16n^2(n^2+1) & = 32n^3 + 8n^2 + 8n+1\\
4(2n+1)^3 - (32n^3 + 8n^2 + 8n+1) & = 40n^2+16n+3\\
10(2n+1)^2 - (40n^2+16n+3) & = 24n+7\\
12(2n+1) - (24n+7) &= 5
\end{align}
Hence,
\begin{align}
\gcd(n^2(n^2+1),2n+1) & = \gcd(32n^3 + 8n^2 + 8n+1,2n+1)\\
& = \gcd(40n^2+16n+3,2n+1)\\
& = \gcd(24n+7,2n+1)\\
& = \gcd(2n+1,5)
\end{align}
</s>