Since the equation is symmetrical with regard to p and q, we can assume abs(p)<=abs(q), and interchange the p and q of any results.
10 for T=1 to 6000
20 for P=1 to int((T)/2)
40 if P<Q then if P^(P+2*Q)=Q^(Q+2*P) then print P;Q
41 if Np^(Np+2*Q)=Q^(Q+2*Np) then print Np;Q
42 if P<Q then if Np^(Np+2*Nq)=Nq^(Nq+2*Np) then print Np;Nq
43 if P^(P+2*Nq)=Nq^(Nq+2*P) then print P;Nq
Overflow in 42
This has ostensibly found all the solutions where the total of the absolute values of p and q is under 664. Keep in mind that the p and q values can be interchanged.
I use the word "ostensibly", as rounding errors for when the exponents are negative may produce mismatches when in theoretical fact the two values are equal (lhs and rhs).
Posted by Charlie
on 2009-09-01 12:35:34