# Thread: difference of two squares

1. ## difference of two squares

Find two integers whose squares have a difference of 1,234,567.

can you find two integers whose squares will produce a difference of any whole number you chose?

if so, how? if not, what kind of numbers can't be chosen.

well... a^2-b^2=1234567

we know a must end in a 1 or 9 and b must end in a 2 or 8 (this is to produce the seven at the end)

i came up with 617289^2-617288^2=1234577 and that's as close as i can get.

any suggestions? first time poster! sorry if it is an unusual / inappropriate post!

much thanks!

2. $n^{2}-(n-1)^{2}=1234567$

n=617284

$617284^{2}-617283^{2}=1234567$

3. Number suchs that,
$n\equiv 0,1,3 (\bmod 4)$
Are expressible as a difference of two square.

And,
$n\equiv 2 (\bmod 4)$
Are not.

4. Hello, perfect square!

Find two integers whose squares have a difference of 1,234,567
Galactus used a very clever bit of trivia.

Consecutive squares differ by consecutive odd numbers.

. . $\begin{array}{cccc} & & & \text{diff} \\ 0^2 & = & 0 & \\ & & & 1 \\ 1^2 & = & 1 & \\ & & & 3 \\ 2^2 & = & 4 & \\ & & & 5 \\ 3^2 & = & 9 & \\ & & & 7 \end{array}$
. . $\begin{array}{cccc}4^2 & = & 16 & \\ & & & 9 \\ 5^2 & = & 25 & \\ \vdots & & \vdots & \vdots \end{array}$

As he pointed out, we want two consecutive integers with a difference of 1234567.

So we have: . $(n + 1)^2 - n^2 \:=\:1,234,567$

. . $n^2 + 2n + 1 - n^2 \:=\:1,234,567\quad\Rightarrow\quad 2n+1 \:=\:1,234,567\quad\Rightarrow\quad 2n \:=\:1,234,566$

. . Hence: . $n \,=\,617,283$

Therefore: . $617,284^2 - 617283^2 \:=\:1,234,567$

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

I suspect that 1,234,567 is prime (but I'm not sure).

If the difference is a composite odd number,
. . there may be an alternate solution.

Example: Find two integers whose squares differ by 133.

Since $\frac{133-1}{2} = 66$, we have: . $67^2 - 66^2 \:=\:133$

. Since $133 = 7\times 19$, we have: . . $19 + 19 + 19 + 19 + 19 + 19 + 19$
. . . . . which can be written: . . $13 + 15 + 17 + 19 + 21 + 23 + 25$
which are the differences of: . $6^2\quad7^2\quad\:8^2\quad\:9^2\quad10^2\quad11^2\ quad12^2\quad13^2$

Therefore: . $13^2 - 6^2 \:=\:133$

5. Originally Posted by Soroban
So we have: . $(n + 1)^2 - n^2 \:=\:1,234,567$

. . $n^2 + 2n + 1 - n^2 \:=\:1,234,567\quad\Rightarrow\quad 2n+1 \:=\:1,234,567\quad\Rightarrow\quad 2n \:=\:1,234,566$

. . Hence: . $n \,=\,617,283$
Such a seemingly difficult question, transformed into simple algebra! Once again! Nice!

6. I suspect that 1,234,567 is prime (but I'm not sure).

No, Soroban, it is not prime.