<s>[INST] Find all positive integers $n$ such that $n^2 + 1$ is divisible by $n+ 1$ 
Find all positive integers $n$ such that $n^2 + 1$ is divisible by $n+ 1$

I know a lot about number theory, for example conjectures, theories, equations and so on. But I just can't solve this type of problems. Which algorithm should i use in order to solve them?
 [/INST] Another proof:
$$gcd(n+1,n^2+1)=gcd(n+1, n^2+1-n(n+1))=gcd(n+1,1-n)=gcd(n+1,1-n+(1+n))=gcd(n+1,2).$$
If $n$ is even, then $n+1$ is odd. Then $gcd(n+1,2)=1$ (is this clear?), this is:
$gcd(n+1,n^2+1)=1$ so that $n+1,n^2+1$ are relative primes.
If $n$ is odd, then $n+1$ is even, so $gcd(n+1,2)=2$, thus $gcd(n+1,n^2+1)=2$. 
Remember that: If $a>0$, then $gcd(a,b)=a \iff a \vert b. $ 
 Then $n+1 \vert n^2+1 \iff gcd(n+1,n^2+1)=n+1,$ then $n+1$ must be equal to $2$, then $n=1$ is the only positive integer that satisfies the property. 
</s>