All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Closest to 1 (Posted on 2024-12-23) Difficulty: 3 of 5
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?

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution proposed solution | Comment 1 of 4
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
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (5)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (7)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information