Hello, primarygun
primarygun said:
Find the 2002nd positive integer that is not the difference of two square integers.
I have idea for the answers, but there are two.
There are two?
I can't understand how could that be.
If we put all these numbers in a series, just one is in the place 2002!
Anyway...
x=a^2-b^2
I SUPPOSE THAT a,b>0
If a number can be written as a difference of two perfect squares then I'll call that number a
perfect difference
Well, that's what I found
First, I wrote down some squares, from 1^2 to 10^2 and I found the differences (you can easy do it on Excel)
I noticed that the differences are either
3,5,7,9,11,..
or
8,12,16,20,24,..
And there is not other!
(But there are numbers which are repeated many times, e.g
24=7^2-5^2, but also
24=5^2-1^2)
That is, the perfect differences are all even numbers (>=3) and all multiples of 4 (>=8)
I think that I must prove it
Well, say x=a^2-b^2 => x=(a+b)(a-b)
(That is we suppose that x is a perfect difference)
Of course a>b
x may be either odd or even
1)
x is even
so x=2q (where q>=1)
(a-b)(a+b)=2q
The second side is even
So a-b is even or a+b is even
but if a-b is even then a+b is even too:
a-b=2k =>
a=b+2k =>
a+b= (b+2k)+b = 2b+2k = 2(b+k)
Then x = 2k*2(b+k) = 4k(b+k)
Since k>=1 & b>=1 the value of k(b+k) has a minimum value 1*(1+1)=1*2=2
So, IF x is even THEN x=4r, where r>=2
(That is, all multiples of 4, except 4)
2)
x is odd
so x=2k+1
but if you set
a=k+1
b=k
then you get a^2-b^2 = (a-b)(a+b) = 1*(k+k+1) = 2k+1
Since b>=1 => k>=1 => x>2*1+1 =>
x>=3
So, IF x is odd & x>=3 THEN x is a perfect difference.
We found that the perfect differences are:
-the odd numbers (>=3)
-the multiples of 4 (>=8)
In other words if x=4k+m (you divide by 4, k is the quotient and m is the remainder)
m=0 => x is a perfect difference
m=1 => x is a perfect difference (because x is odd)
m=3 => x is a perfect difference (because x is odd)
But if m=2 <=> x=4m+2 <=> x=2(2m+1)
then x isn't divisible by 4, so x is NOT a perfect difference
The desired numbers are all the doubles of an odd, x=2(2m+1)
and also, x=4 and x=1
(x=4 is the only multiple of 4 which is less than 8
x=1 is the only odd number <3)
So, can you now find which NON perfect difference is at the place 2002?
If you don't understand something, just tell me, ok?