a, b, c are three distinct whole numbers. How close can 1/a+1/b+1/c be to 1 while being still less than it?
univ=2:200;
idx=combinator(length(univ),3,'c');
sets=univ(idx);
mx=0;
for i=1:length(sets)
s=sets(i,:);
p=prod(s);
if s(1)*s(2)+s(3)*s(2)+s(1)*s(3)<p % all integer avoids rounding error
v=sum(1./s);
if v>mx
mx=v;
best=s;
end
end
end
best
mx
finds a, b, c and the total of 1/a + 1/b + 1/c:
best =
2 3 7
mx =
0.976190476190476
1/52 short of 1.
|
Posted by Charlie
on 2024-12-23 08:52:49 |