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

Home > Just Math
4 basic operations (Posted on 2024-05-21) Difficulty: 3 of 5
Let's select 2 integers in the range of 1 TO 100, say X and Y , (X>Y). To avoid fractions X should be a multiple of Y.
On those two integers we will perform 4 operations (addition, subtraction, multiplication and division) and then sum up the 4 answers.

Example X = 81 and Y = 9
sum would be 90
difference 72
product 729
and quotient 9

altogether 900

It's up to the solver to convert the final result, restoring the original values of X and Y.

Solve for final result 324

See The Solution Submitted by Ady TZIDON    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution | Comment 1 of 10
The largest y can be is 50.
The (x,y) values resulting in 324 are:

[[81, 1], [72, 2], [45, 5], [32, 8]]

The program creates a dictionary where the keys are the computed sums, and the values are lists of lists of x,y pairs that produce those sums.
-------------
ans = {}
for y in range(1,51):
    for division in range(2, 1+int(100/y)):
        x = y*division
        mult = x*y
        add = x+y
        diff = x-y
        calc = division + mult + add + diff
        if calc not in ans:
            ans[calc] = [[x,y]]
        else:
            ans[calc].append([x,y])
        
print(ans[324])

  Posted by Larry on 2024-05-21 08:44:01
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