Question on Number theory to find sum value of n Let $S_n = n^2 + 20n + 12$, $n$ a positive integer. How do I get the sum of all possible values of $n$ for
which $S_n$ is a perfect square?

As $(n+2)^2<n^2+20n+12<(n+10)^2$ and $20n+12$ is even the only 3 cases  are to be considered 
$n^2+20n+12=(n+4)^2, \ \ n^2+20n+12=(n+6)^2,\ \ n^2+20n+12=(n+8)^2$ 
