a, b, and x are positive integers such that
sqrt(a) + sqrt(b) = sqrt(x)
How many possible values of x less than or equal to 1000 are there?
It seems to me that there are a rather large number of valid solutions. a, b, and x must all be squares, and x can be no larger than 1000, so the sqrt's can add up to no more than 31 (31^2 = 961, 32^2 = 1024).
<pre>
sqrt ^2
1 1
2 4
3 9
4 16
5 25
6 36
7 49
.
.
.
30 900
31 961
</pre>
Now we just need to find all the values from that list where the numbers from the first column add up to no more than 31. So a=1, b=1, x=4 (1+1=2) through a=225, b=256, x=961 (15+16=31). I'm assuming that we're not looking for reversals of a and b, so if we already have sqrt(1)+sqrt(900)=sqrt(961) we don't later include sqrt(900)+sqrt(1)+sqrt(961).
If that is the case, then I count 345 unique solutions.

Posted by Erik O.
on 20050505 18:51:48 