T
T
Tera Incognita2021-04-07 09:57:05
Mathematics
Tera Incognita, 2021-04-07 09:57:05

Who knows algorithms well?

There is this expression:

a + b = a * b

What are the values ​​of a and b?
The answer can be seen immediately - it's two and two. Since a and b are integers, and if we take just a search, then the only value is 2.

2 + 2 = 2 * 2

It doesn’t even take 10 seconds to answer.
But how to write it mathematically? And how to write a iteration cycle programmatically?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2021-04-07
@Lunali

This is solved analytically.
a + b = a b
a + b - a b = 0
a (1 - b) + b = 0
a = b / (b - 1)
Obviously, this fraction will be an integer only in two cases,
b - 1 = -1, b = 0, a = 0
b - 1 = 1, b = 2, a = 2

S
Sergey Sokolov, 2021-04-07
@sergiks

The graphical calculator suggests that there are infinitely many solutions, and they lie on two parabolas.
The inclined plane is the sum, the "saddle" is the product. Their intersection is where they are equal.

schedule
606dd79c51e04542511886.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question