3. Let $n$ be a positive integer and $d$ be the greatest common divisor of $n^{2}+1$ and $(n+1)^{2}+1$. Find all the possible values of $d$. Justify your answer.
3. For $n=1$ and $n=2$, the ged are 1 and 5 , respectively. Any common divisor $d$ of $n^{2}+1$ and $(n+1)^{2}+1$ divides their difference, $2 n+1$. Hence $d$ divides $4\left(n^{2}+1\right)-(2 n+1)(2 n-1)=5$. Thus the possible values are 1 and 5 .