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

Home > Just Math
AB Crossed Floor Product (Posted on 2021-12-08) Difficulty: 3 of 5
Determine positive real numbers A and B that satisfy this equation:
2*A*floor(B) = 2020, and:
3*B*floor(A) = 2021

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

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


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
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