How many numbers below 100 can be expressed as a difference of two perfect squares in only one way?
1. 25 2. 26 3.34 4.35
Please do post explanation.
Say 1<=k<=100 and (x^2) - (y^2) = k = ab (where a<=b are two factors of k)
Hence,
(x+y)(x-y)=k=ab
We can safely assume..
x + y = a
x - y = b
We get..
x = (a+b)/2
y = (a-b)/2
From above equations for x and y.. we can see that either a and b are both odd or both even. (this is due to the fact that x^2 and y^2 are perfect squares)
We know that for all k, its a possibility that b=1 and a=k. In this case, if a is odd we will have a solution for x and y. If a is even this will yield no solutions.
For odd k, b=1 and a=k will have solutions. Now we have to look for odd numbers k which have no other set of odd factors a and b except for 1 and k. This is same as looking for odd prime numbers. They will have no other combinations of a and b and hence can be represented as a difference of two perfect squares in only one way. Hence we get 24 solutions.
Similarly, for k=1 we will have a=b=1 and this will also yield a solution and as 1 has no other factors this will also be a solution. Hence we get 1 solution.
For even k, b=1 and a=k will give no solutions. Hence all even numbers, which will have a set of factors a and b where both a and b are even will have a solution for x and y. Also the condition is that these even k should have only one set of such factors a and b. For all prime numbers p converted to even by multiplying by 4, will satisfy this criteria as for all such k=4p, possible sets of (b,a) will be (1,4p), (2,2p) and (4,p). Of this only, b=2 and a=2p will give a solution for all odd primes. This will give us 8 solutions (for p = 3,5,7,11,13,17,19,23).
For prime 2, the pairs and (2.2p) and (4,p) will both give solutions but eventually both would be same set of factors i.e. (2,4). This will give us 1 solution.
Hence total number of solutions = 24+1+8+1 = 34