Determine all possible triplet(s) of positive integers such that each of p*q-r, q*r-p, and r*p-q is a power of 2.
*** Adapted from a problem appearing in IMO 2015.
clearvars,clc
for t=1:1000
for p=1:t/3
for q=p+1:(t-p)/2
r=t-p-q;
if p*q-r>0 && q*r-p>0 && p*r-q>0
a=p*q-r; b=q*r-p; c=p*r-q;
la=log(a)/log(2);lb=log(b)/log(2);lc=log(c)/log(2);
if 2^round(la)==a && 2^round(lb)==b && 2^round(lc)==c
disp([p q r a b c] )
end
end
end
end
end
finds
p q r the formala values
3 5 7 8 32 16
2 6 11 1 64 16
no guaarantee of completeness. Of course the values of p, q and r can be rearranged.
|
Posted by Charlie
on 2023-04-15 10:58:47 |