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?

Let $$n^2+20n+12=(n+a)^2\iff n=\dfrac{a^2-12}{2a-10}$$
So, $a$ must be even $=2b$(say)
$$\implies n=\dfrac{4b^2-12}{2(2b)-10}=\dfrac{b^2-3}{2b-5}$$
Now if integer $d$ divides $2b-5,b^2-3$
$d$ must divide $2(b^2-3)-b(2b-5)=5b-6$
$d$ must divide $2(5b-6)-5(2b-5)=13$
A necessary condition for $(2b-5)|(b^2-3)$  is $(2b-5)\mid13$
Can you take it from here?
