# Thread: [SOLVED] difference of two squares problem!!

1. ## [SOLVED] difference of two squares problem!!

the question is that K(N) denotes the no. of ways in which N can be expressed as the difference of two perfect squares, then which of the following is maximum: K(110), K(105), K(216), K(384)????
i need to know where to start from.

2. I think you should start from: $\displaystyle a^2-b^2=(a-b)(a+b)$. So you need to factor those numbers...

3. Hello, nandu11!

Lucky for us, I've played with the Difference-of-Squares long ago.

$\displaystyle K(n)$ denotes the number of ways in which $\displaystyle n$
can be expressed as the difference of two perfect squares.

Then which of the following is maximum? .$\displaystyle K(110),\;K(105),\;K(216),\;K(384)$

Suppose $\displaystyle n$ is a product, $\displaystyle PQ,$ where $\displaystyle P \geq Q.$

Then we want integers $\displaystyle a$ and $\displaystyle b$ so that: .$\displaystyle a^2-b^2 \:=\:PQ$

So we have: .$\displaystyle (a+b)(a-b) \:=\:PQ$

We assume that: .$\displaystyle \begin{array}{ccc}a+b &=&P \\ a-b &=& Q\end{array}$

. . and solve the system: .$\displaystyle \begin{array}{ccc}a &=&\dfrac{P+Q}{2} \\ \\[-4mm] b &=&\dfrac{P-Q}{2}\end{array}$

Since $\displaystyle a$ and $\displaystyle b$ are integers, $\displaystyle P$ and $\displaystyle Q$ must have the same parity.
. . (Both are even or both are odd.)

Let's examine each of the $\displaystyle n$'s.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

$\displaystyle n \:=\: 110 \:=\:2\cdot5\cdot11$

110 cannot be factored into two factors with the same parity.
Hence, 110 cannot be expressed as a difference of squares.
. . $\displaystyle K(110) \:=\:0$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

$\displaystyle n \:=\:105 \:=\:3\cdot5\cdot7$

105 has four possible factorings.

. . $\displaystyle \begin{array}{c|c} (P,Q) & (a,b) \\ \hline (105,1) & (53,52) \\ (35,3) & (19,16) \\ (21,5) & (13,8) \\ (7,15) & (11,4) \end{array}\quad K(105)\:=\:4$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

$\displaystyle n = 216 \:=\:2^3\cdot3^3$

216 has four possible factorings.

. . $\displaystyle \begin{array}{c|c} (P,Q) & (a,b) \\ \hline (108,2) & (55,53) \\ (54,4) & (29,25) \\ (36,6) & (21,15) \\ (18,12) & (15,3) \end{array} \quad K(216) \:=\:4$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

$\displaystyle n \:=\:384 \:=\:2^7\cdot3$

384 has six possible factorings.

. . $\displaystyle \begin{array}{c|c} (P,Q) & (a,b) \\ \hline (192,2) & (97,95) \\ (96,4) & (50,46) \\ (64,6) & (35,29) \\ (48,8) & (28,20) \\ (32,12) & (22,10) \\ (24,16) & (20,4) \end{array}$ . $\displaystyle K(384) \:=\:6$ . $\displaystyle {\color{blue}\leftarrow\text{ maximum!}}$