TITLE: Find the sum of all values of $a$ satisfying that there exist positive integers $a,b$ satisfying $(a-b) \sqrt{ab}=2016$
QUESTION [10 upvotes]: Find the sum of all values of $a$ satisfying that there exist positive integers $a,b$ satisfying $$(a-b) \sqrt{ab}=2016$$

my try 
let $a= x^2$  , $b= y^2$ $\to$ $(a-b) \sqrt{ab}$=$(x^2-y^2)(xy)=2016$
is this approach appropriate for this problem ? please elaborate your help

REPLY [4 votes]: $$\text{Find} \;\sum_{(a,b) \in S}a 
  \qquad \text{where} \qquad
  S=\{(a,b)\in \mathbb Z^+ : (a-b)\sqrt{ab}=2016\}$$
Let $(a,b) \in S$ and let $x = \sqrt{ab}$. Then $(a-b) = \dfrac{2016}{x}$.
So
$$\left\{
\begin{array}{c}
  a = \sqrt{ab + \frac 14(a-b)^2} + \frac 12(a-b) \\
  b = \sqrt{ab + \frac 14(a-b)^2} - \frac 12(a-b) \\
\end{array}
\right\}
\implies
\left\{
\begin{array}{c}
  a = \sqrt{x^2 + \dfrac{1008^2}{x^2}} + \dfrac{1008}{x} \\
  b = \sqrt{x^2 + \dfrac{1008^2}{x^2}} - \dfrac{1008}{x} \\
\end{array}
\right\}$$
We need to solve $x^2 + y^2 = z^2$ where $xy = 1008$.
For now, because of symmetry, we can assume $x < y$.  Then the possibilities for $x$ are
$$x \in \{1, 2, 3, 4, 6, 7, 8, 9, 12, 14, 16, 18, 21, 24, 28\}$$
Working mod 11.
The quadratic residues modulo $11$ are
\begin{array}{|c|cccccc|}
\hline
   x   & 0 & 1,10 & 2,9 & 3,8 & 4,7 & 5,6 \\
   x^2 & 0 & 1    & 4   & 9   & 5   & 3 \\
\hline
\end{array}
Since $xy = 1008 = 7 = 18 = 29 = 40 = 51 = 62 = 73 = 84 = 95 \pmod{11}$, the possibilities for $x,y$ (accounting for $x, y$ symmetry) are
\begin{array}{|c|ccccc|}
\hline
   x         & 1 & 2 & 3 & 4  & 5 \\
   y         & 7 & 9 & 6 & 10 & 8 \\
   x^2 + y^2 & 6 & 8 & 1 & 6  & 1 \\
\hline
\end{array}
We find $x \pmod{11} \in \{3,5,6,8\}$.
This whittles the list down to 
$$x \in \{3, 6, 8, 14, 16, 28\}$$
Working mod 13.
The quadratic residues modulo $13$ are
\begin{array}{|c|cccccc|}
\hline
   x   & 0 & 1,12 & 2,11 & 3,10 & 4,9 & 5,8 & 6,7 \\
   x^2 & 0 & 1    & 4    & 9    & 3   & 12  & 10 \\
\hline
\end{array}
Since $xy = 1008 = 7 = 20 = 33 = 46 = 59 = 72 = 85 = 98 \pmod{13}$,
the possibilities for $x,y$ (accounting for $x, y$ symmetry) are
\begin{array}{|c|ccccc|}
\hline
         x & 1  & 2  & 3  & 4 & 6  & 8\\
         y & 7  & 10 & 11 & 5 & 12 & 9\\
   x^2+y^2 & 11 & 0  & 0  & 2 & 11 & 2 \\
\hline
\end{array}
We find $x \pmod{13} \in \{ 2, 3, 10, 11 \}$ This whittles the list down to 
$$x \in \{3, 16, 28\}$$
We compute $x, y,$ and $z$.
\begin{array}{ccc}
x & y=\dfrac{1008}{x} & z=\sqrt{x^2+y^2} \\
\hline
                 3 &             336 & 336.0133926 \\
   \color{red}{16} & \color{red}{63} & \color{red}{65} \\
                28 &              36 & 45.607017 \\
\hline
\end{array}
Hence
\begin{array}{ccc|cc|c}
   x & y=\frac{1008}{x} 
     & z=\sqrt{x^2+\left(\frac{1008}{x}\right)^2} 
     & a=z+y & b=z-y & (a-b)\sqrt{ab} \\
\hline
   16 & 63 & 65 & 128 & 2 & 2016 \\
   63 & 16 & 65 & 81 & 49 & 2016 \\
\hline
\end{array}
So $\sum_{(a,b)\in S}a  = 128 + 81 = 209$