TITLE: When is this integer a perfect square: $n^2 + 20n + 12$
QUESTION [7 upvotes]: Let $S_n = n^2 + 20n + 12$, where  $n$ a positive integer. What is the sum of all possible values of $n$, for which $S_n$ is a perfect square?

Help me to solve it.

REPLY [3 votes]: $ n^{2}+20n+12=k^{2} \iff k \in \mathbb{Z}$ then we proceed with $ (n+10)^{2}-k^{2}=88 $ (I have skipped the operations). If we factor them out $\implies (n+10-k)\cdot(n+10+k)=88$, and match them with the factors of $88$ such that both $n \land k \in \mathbb{Z}$, the problem is done.