If I had known how easy (and early in the search) this was, I'd not have written the program.
The logic is to test the possible values of floor(A), as that's guaranteed integral; then from that find the exact value of B; then use floor(B) to find A. As soon as the final A agrees with the assumed floor(A), that's a solution.
clc
clearvars
syms a b fa fb
for fa=1:1200
b=sym(2021)/(3*fa);
fb=floor(b);
a=2020/(2*fb);
if floor(a)==fa
disp([a b])
disp([eval(a) eval(b)])
end
end
produces
[1010/673, 2021/3]
1.50074294205052 673.666666666667
indicating
A = 1010/673 ~= 1.50074294205052
B = 2021/3 ~= 673.666666666667
found on the very first try, of floor(A) (variable fa) equal to 1.
|
Posted by Charlie
on 2021-12-08 07:37:10 |