Find the sum of the all possible values of $n$ such that $5\cdot 3^m+4=n^2$ $5\cdot 3^m+4=n^2$.
Find the sum of all possible values of $n$. 
It is an question from prermo 2016 west Bengal exam. I try to do it using theory of congruence. But I can't proceed. I am disappointed, how do I find the sum? Can anybody can help me? 
Thank you 

Given equation can be re written as 
$$5\cdot 3^m = (n-2)(n+2)$$
let $\gcd((n-2),(n+2))=d$ So $d|(n+2)-(n-2)=4$ Thus possible values for $d$ is $1,2,4$. As $d|(5\cdot 3^m), d=1$ as $5\cdot 3^m$ is odd for all values of $m$. This ensure that $5\cdot 3^m$ can only be factored as $5$ and $3^m$ , not as $5\cdot 3^k$ and $ 3^{(m-k)}$ where $1 \le k \le m$ as on that case $\gcd(5\cdot3^k,3^{(m-k)})=3^r$ where $r=min(k,m-k)$ , but that is not possible. So either $n-2=5$ and $n+2= 3^m$ or $n+2=5$ and $n-2= 3^m$. From first case we get $(m,n)=(2,7)$ and from second case we get $(m,n)=(0,3)$
