Due to the symmetric relation of P and Q, it is necessary to check only the cases where P<=Q, and then swap P and Q for any solutions found.
list
10 for T=1 to 10000
20 for P=1 to int(T/2)
30 Q=T-P
40 V1=P*P+3*Q:V2=Q*Q+3*P
50 Sr1=int(sqrt(V1)+0.5)
60 Sr2=int(sqrt(V2)+0.5)
70 if Sr1*Sr1=V1 then
80 :if Sr2*Sr2=V2 then
90 :print P;Q,V1;V2,Sr1;Sr2
100 next P
110 next T
OK
run
1 1 4 4 2 2
11 16 169 289 13 17
OK
indicating that among all cases where P+Q <= 10,000, there are three solutions: (1,1), (11,16) and (16,11).
The squares involved in the first case are both 2^2 = 4.
The squares involved in the latter two cases are 13^2=169 and 17^2=289.
|
Posted by Charlie
on 2009-08-10 12:49:50 |