# 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

• What are the possible values of $m$? Commented Sep 14, 2016 at 4:15
• Also, a hint for the solution: subtract 4 from both sides and factor the right-hand side... Commented Sep 14, 2016 at 4:17
• Is m presumed to be a constant. Commented Sep 14, 2016 at 6:17
• Are n and m presumed to be integers? Are the sum supposed to be the sum of the two roots relative to m, or are there supposed to be multiple different sets of solutions for different ms. The question is very unclear. Commented Sep 14, 2016 at 6:20
• Honestly, the way the question is worded, I would argue the sum is $\sqrt {5\cdot 3^m+4} +(- \sqrt {5\cdot 3^m+4})=0$. I know that is not the intended answer but it is the answer as written. I think the question needs clarification. Commented Sep 14, 2016 at 6:24

We can move the $4$ over to the RHS and factor it as a difference of squares:

$$5\cdot 3^m = (n-2)(n+2)$$

Note that the two factors on the right differ by $4$, so they cannot be both divisible by $3$. This means that $3^m|n-2$ or $3^m|n+2$. In addition, the other factor must divide $5$, so it is either $1$ or $5$.

Case 1: $n-2 = 1$.

In this case, we get that $n=3$ and that $m=0$, a valid solution.

Case 2: $n+2 = 5$.

This yields the same result as case 1.

Case 3: $n-2 = 5$.

This yields $n=7, m=2$, also resulting in a valid solution. Thus, the answer is the sum of all possible values of $n$, or $10$.

(Note: I'm assuming you meant all positive values of $n$. Otherwise, since the equation is satisfied for $-n$ iff it is satisfied for $n$, the sum is trivially $0$, and it is a bad trick question.)

• "The other factor must divide $5$"? Do you mean "The other factor must be divisible by $5$"? Also, why the other factor? Could be the same factor which is divisible by $3^m$ (if not, then please elaborate because it is not so trivial). Commented Sep 14, 2016 at 4:21
• @barakmanos Let the factors be $a$ and $b$, and let $3^m|b$. Then, we have that, since $ab = 5\cdot 3^m$, or $a = \frac{5\cdot 3^m}{b}$, and $3^m|b$, $a|5$. And it can be the same factor (one of them is divisible by $5$ - if $a$, then $a=5$, and if $b$ is, then $a=1$,$b=5\cdot 3^m$). Commented Sep 14, 2016 at 4:35

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)$