Positive Integers - Difference of two squares

Nazariy

Junior Member
Joined
Jan 21, 2014
Messages
124
Hi everyone,

I am certain you have come across this before. It is that you can express odd and even (that have a factor of 4) numbers as the difference of two positive integer squares.

I can prove for both cases that indeed the proposition is valid. However I cannot show why even numbers that do not divide fully into 4 cannot be expressed as the difference of two positive integer squares.

Can someone help me out? Google is not of much help.

Here is what I have noticed:
\(\displaystyle a^2-b^2=(a-b)(a+b)=n\)

Now if n has a factor of 4, then (a-b) is even and (a+b) is even too. For odd numbers, (a-b) always = 1, and therefore (a+b) = odd (i.e. 7=(4-3)(4+3)=1*(4+3)=1*7=7).

However numbers like 2,6,10 (cannot be expressed as the difference of two positive integer squares) are derived by multiplying an odd and an even, e.g. 2=2*1, 6=2*3, 10=2*5;

I wonder whether I just show that since (a+b)>(a-b) then (a+b) = 2 and (a-b) = 1 for n = 2, and similarly (a+b)=3 and (a-b) = 2 for n = 6 etc. That there are no integer solutions for a and b? How would I generalize this result?

P.S. Bonus question :) How can I show that \(\displaystyle (a+b) \geq \sqrt{n}\) and hence \(\displaystyle (a-b) \leq \sqrt{n} \)

Thank you :D
 
I found a way to generalize the solution. So if you could help me please with bonus question that would be awesome. Thank you

Let \(\displaystyle n=2p\) where p>2 and is clearly odd (because 2=2*1 (1 is odd), 6=2*3 (3 is odd) and so on)
Then

\(\displaystyle \begin{cases} a+b=p \\ a-b=2 \end{cases}\)
\(\displaystyle a = 1+ p/2 \)

Since p is odd, p/2 is not integer, hence a is not integer, hence n cannot be expressed as the difference of two positive squared integers
 
Last edited:
I found a way to generalize the solution. So if you could help me please with bonus question that would be awesome. Thank you

Let \(\displaystyle n=2p\) where p>2 and is clearly odd (because 2=2*1 (1 is odd), 6=2*3 (3 is odd) and so on)
Then

\(\displaystyle \begin{cases} a+b=p \\ a-b=2 \end{cases}\)
\(\displaystyle a = 1+ p/2 \)

Since p is odd, p/2 is not integer, hence a is not integer, hence n cannot be expressed as the difference of two positive squared integers

Almost but not quite. It is true that one of a+b and a-b must be even and the other odd but they do not have to be p and 2 (or 2 and p).

Suppose that you have three numbers c, d, and e so that
c d = e2
and
c > e.
Since
d = e2 / c
what can you say about the size relationship between e and d?
 
Almost but not quite. It is true that one of a+b and a-b must be even and the other odd but they do not have to be p and 2 (or 2 and p).

Suppose that you have three numbers c, d, and e so that
c d = e2
and
c > e.
Since
d = e2 / c
what can you say about the size relationship between e and d?

The only numbers that cannot be made into difference are those that are factors of 2 and do not divide fully into 4, therefore 2 is always a factor in these numbers.

i do not understand what kind of numbers c, d and e are. Are you calling c to be (a+b) and d to be (a-b)?

If c*d = e^2 then c=d=e
 
Since when?
9 * 16 = 5^2


Yeah, I knew it was wrong... But then I don't understand... I thought only even numbers that do not divide into 4 cannot be expressed as difference. For example for first 1000 numbers only 250 cannot be expressed as difference of squared integers, thus this pattern pertains for all consecutive numbers


wait how 9*16=25? 9*16=144. You are thinking of addition there
 
Since when?
9 * 16 = 5^2 ............... Really !! .... 144 is now so happy ... nobody calls him square...

Corner ... Corner ... to the corner .... facing the wall... for 12 minutes....
 
Bad example, Denis, but try
9 * 16 = 12^2



Yes and e=\(\displaystyle \sqrt{n}\). Also if a and b are positive then it is easy to show that
a+b > a - b


Well that is my bonus question, I don't see why c>e, even though d=e^2/c
 
Well that is my bonus question, I don't see why c>e, even though d=e^2/c

If both a & b are positive numbers - you cannot prove (a+b)>(a-b) ??!!!

suppose (a+b)< (a-b)

Then

(a+b)- (a-b) < 0

b < 0 → reductio ad absurdum (we assumed b is positive)
 
If a and b are positive so is a+b and
a+b>a>a-b

Now use the fact that if
c > d
and e is positive, then
e c > e d

Makes sense, but how is c>e? c is more than d


i think I got it. But this is a very dodgy thinking. You have c d = e e

on LHS: big*small = medium*medium. Clearly big > medium and small < medium. However this still does not show why big >= medium. Because if it equals medium, then small is also medium. Oh ok... Cuz u can have just two square roots multiplied by each other on the LHS. Got it

thank you Ishuda. I still don't see why my proof is not correct. Because as I said all the numbers that cannot be written as diff are multiples of two and odd number.

plus, where have you been leading me with the relationship between e and d ?
 
Last edited:
If both a & b are positive numbers - you cannot prove (a+b)>(a-b) ??!!!

suppose (a+b)< (a-b)

Then

(a+b)- (a-b) < 0

b < 0 → reductio ad absurdum (we assumed b is positive)

e is not (a-b). e is square root of n

clearly a+b> a-b ...
 
Yeah, I knew it was wrong... But then I don't understand... I thought only even numbers that do not divide into 4 cannot be expressed as difference. For example for first 1000 numbers only 250 cannot be expressed as difference of squared integers, thus this pattern pertains for all consecutive numbers


wait how 9*16=25? 9*16=144. You are thinking of addition there

Where did this bit of wisdom come from? If we let
s = a - b
then
a2 - b2 = (s+b)2 - b2 = 2 b s + s2 = s (2 b + s)
Then, if that is true we must have non-negative numbers b and s such that
2 = s (2 b + s)
Interesting. Since two is even at least one of the factors s and 2b+s must be even. If s is even, then 2b+s must be even since it is the sum of even numbers. If 2b+2 is even then so is s since subtracting an even number (2b) from an even number (2b+s) must leave an even number (s). So 2 must be the product of 2 even numbers. Hmmmmmm.
 
Where did this bit of wisdom come from? If we let
s = a - b
then
a2 - b2 = (s+b)2 - b2 = 2 b s + s2 = s (2 b + s)
Then, if that is true we must have non-negative numbers b and s such that
2 = s (2 b + s)
Interesting. Since two is even at least one of the factors s and 2b+s must be even. If s is even, then 2b+s must be even since it is the sum of even numbers. If 2b+2 is even then so is s since subtracting an even number (2b) from an even number (2b+s) must leave an even number (s). So 2 must be the product of 2 even numbers. Hmmmmmm.

Where did this come from 2=s(2b+s)? I mean the 2 part

2 is not a product of two even numbers...

That bit if wisdom came from thinking... I have first
showed that all odd numbers can be expressed as difference, then I have showed that all numbers that have factor 4 can be expressed. And then the only numbers left to show are those that are factors of 2 but not 4. So first 1000 numbers have 500 odd and 500 even numbers, since half of even numbers cannot be expressed, we thus have 750 numbers that can be expressed as difference
 
Where did this bit of wisdom come from? If we let
s = a - b
then
a2 - b2 = (s+b)2 - b2 = 2 b s + s2 = s (2 b + s)
Then, if that is true we must have non-negative numbers b and s such that
2 = s (2 b + s)
Interesting. Since two is even at least one of the factors s and 2b+s must be even. If s is even, then 2b+s must be even since it is the sum of even numbers. If 2b+2 is even then so is s since subtracting an even number (2b) from an even number (2b+s) must leave an even number (s). So 2 must be the product of 2 even numbers. Hmmmmmm.

Suppose our difference of squares is \(\displaystyle a^2-n^2\), where \(\displaystyle a = n+x \)

Then we have \(\displaystyle (n+x)^2-n^2=x^2+2nx=x(2n+x) \)

If x is odd then we have odd*odd=odd
If x is even then we have even*even=even

But where does the 2 come from?
 
Suppose our difference of squares is \(\displaystyle a^2-n^2\), where \(\displaystyle a = n+x \)

Then we have \(\displaystyle (n+x)^2-n^2=x^2+2nx=x(2n+x) \)

If x is odd then we have odd*odd=odd
If x is even then we have even*even=even

But where does the 2 come from?
You said "For example for first 1000 numbers only 250 cannot be expressed as difference of squared integers". O.K. 2 is one of the first 1000 numbers so find an n and an x so that
2 = x(2n+x)
 
However I cannot show why even numbers that do not divide fully into 4 cannot be expressed as the difference of two positive integer squares.

As you pointed out, \(\displaystyle a^2-b^2=(a+b)(a-b)\). If \(\displaystyle a,b\) are both odd or both even, then \(\displaystyle a+b\) and \(\displaystyle a-b\) are both even and so their product is divisible by 4. If one of \(\displaystyle a,b\) is odd and the other even, then \(\displaystyle a+b\) and \(\displaystyle a-b\) are both odd and so their product is odd. Hence \(\displaystyle a^2-b^2\) is always either odd or divisible by 4; it cannot be even and not divisible by 4.
 
You said "For example for first 1000 numbers only 250 cannot be expressed as difference of squared integers". O.K. 2 is one of the first 1000 numbers so find an n and an x so that
2 = x(2n+x)

\(\displaystyle 2=2*1
\\2=(a+b)(a-b)


\\ \begin{cases}
(a+b)=2,
\\(a-b)=1;
\end{cases}

\\ a=\frac{3}{2}
\\ b=\frac{1}{2}

\\ 2=\displaystyle{(\frac{3}{2})^2-(\frac{1}{2})^2}

\\ n=\frac{1}{2} \ and \ x=1
\)

n is a fraction and x=1, none of which is even

or

\(\displaystyle 2=2xn+x^2
\\(x+n)^2-n^2=2
\\x+n=\sqrt{n^2+2}
\\x=-n \pm \sqrt{n^2+2}
\)
 
Last edited:
Top