\documentclass[a4paper,12pt]{article}

\begin{document}

\parindent=0pt

QUESTION

Represent 765 as a sum of two squares. Represent 323 as a sum of
four squares.

[Hint: Factorise them first]





ANSWER

$765=5.153=5.3.51=5.3^2.17.$

Now $5=2^2+1^2$, so $5.3^2=(2^2+1^2).3^2=(2.3)^2+(1.3)^2=6^2+3^2$.
Also $17=4^2+1^2$. Hence $5.3^2.17=(6^2+3^2)(4^2+1^2)$, and using
the identity $(a^2+b^2)(c^2+d^2)=(ac+bd)^2+(ad-bc)^2$, we get
$5.3^2.17=(24+3)^2+(6-12)^2=27^2+6^2$.

$323=17.19$

Now $17=4^2+1^2=4^2+1^2+0^2+0^2$, and $19=4^2+1^2+1^2+1^2$, so
using the identity

\begin{eqnarray*}
(a^2+b^2+c^2+d^2)(e^2+f^2+g^2+h^2)&=&(ae+bf+cg+dh)^2\\
&+&(af-be+ch-dg)^2\\ &+&(ag-bh-ce+df)^2\\ &+&(ah+bg-cf-de)^2
\end{eqnarray*}

we get
$17.19=(16+1+0+0)^2+(4-4+0-0)^2+(4-1-0+0)^2+(4+1-0-0)^2=17^2+0^2+3^2+5^2$




\end{document}
