<s>[INST] Find all even numbers that can be represented as a difference of squares in only two ways I am currently working on this proof. I am looking to find (with proof) all even numbers that can be represented as a difference of squares in only two ways.
My thoughts thus far.
I examined the first 40 natural numbers and found that 16, 24, 32, 40 have exactly two representations as a difference of squares. My claim is that all numbers $x$ for which $x=8k+16$ will have exactly two representations. 
$8k+16=(k+a)^2 - (k+b)^2$ $\rightarrow$ $8k+16=(k+4)^2 - k^2$ which is the first representation.
My idea for finding the second representation is to express $8k+16$ as
$8k+16=(ak+b)^2 - (ck+d)^2$
Expanding and attempting to solve I get:
$$\left.\begin{matrix}
 a^2 - c^2 = 0\\ 
2ab - 2cd= 8\\
b^2 - d^2= 16
 \end{matrix}\right\}$$
This is where my problem arises, $b^2-c^2=(b-c)(b+c)=16=4^2$, I cannot seem to move on from here.
If anyone can offer a hint that would help with my understanding of the problem and the attempt at the proof, that would be extremely helpful. Thank you.
 [/INST] We have $$2n=a^2-b^2=(a-b)(a+b)$$
$a-b$, $a+b$ must be of the same parity, and that parity must be even, since otherwise their product wouldn't be the even number $2n$.  Hence $n$ is even, so we may as well have $$4m=(a-b)(a+b)$$
or $$m=\frac{a-b}{2}\frac{a+b}{2}$$
Hence, we factor $m=st$, with $s\le t$, and set $\frac{a-b}{2}=s$, $\frac{a+b}{2}=t$, or $a=s+t$, $b=t-s$.
For $16$, we have $4=1\cdot 4=2\cdot 2$.  This leads to $\{a=5, b=3\}$ and $\{a=4,b=0\}$.
For $24$, we have $6=1\cdot 6=2\cdot 3$.
For $32$, we have $8=1\cdot 8=2\cdot 4$.
It appears that the desired $n$ are of the form $4pq$, for $p,q$ not necessarily distinct primes, and of the form $4p^3$.  $pq$ has factorizations $1\cdot pq=p\cdot q$, and $p^3$ has factorizations $1\cdot p^3=p\cdot p^2$.  It's a bit tedious to look at various cases, but I'm fairly sure that all other forms for $n$ will have more than two factorizations, leading to more than two $\{a,b\}$ pairs. Also not proved (but I think not too hard) is that two different factorizations must lead to different $\{a,b\}$ pairs.
</s>