What is the number of ways of expressing $120$ as a difference of two perfect squares? I started this as follows.
$120 = a^2 - b^2 = (a+b)(a-b)$
After doing a lot of hit and trial I can come with the answer but that takes time. Is there any other quick way to solve this?
 A: You have that $a+b$ and $a-b$ are factors of $120$.  If one factor is even, the other must be even as well.  So you'll want to factor $120$ as $(2m)(2n)$, where $mn=30$.  Assuming you want $a$ and $b$ positive, $30$ can be written as the product of $2$ positive factors in $4$ ways.  To ensure a positive result, select twice the largest factor of each pair as $a+b$.
A: Note that $120=2^3\cdot 3 \cdot 5$
Now if the factorisation is $(a+b)(a-b)=uv=120$, you have $u+v=2a, u-v=2b$
Since $u$ and $v$ differ by an even number, they are both even or both odd. Since their product is even, they both must be even.
Now look at the even part of the factorisation and you see that one of $u,v$ has the factor $2$ and the other the factor $4$.
The odd part of the factorisation is then $1,3,5,15$. To get all the possibilities, match these with $2$ and the $4$ factor will come out anyway.
$2\times 1=2, 60 = v, u: a=31, b=29$
$2 \times 3=6, 20 = v, u: a= 13, b= 7$
$2 \times 5 =10, 12 = v,u: a=11, b=1$
$2\times 15=30, 4 = u, v: a=17, b=13$
