Present the number 123 as a sum of terms, the product of which is equal to a given number.
Let us denote this number by A, and the required terms by x and y.
By the condition of the problem, we have:
x + y = 123,
x * y = A.
From the first equation we get: y = 123 – x.
Therefore, we have:
x * y = x * (123 – x) = A,
x ^ 2 – 123 * x + A = 0.
We got a quadratic equation:
Discriminant D = (b ^ 2 – 4 * a * c) = 123 ^ 2 – 4 * A.
x1 = (123 – √ (123 ^ 2 – 4 * A)) / 2,
x2 = (123 + √ (123 ^ 2 + 4 * A)) / 2.
From here we get:
y1 = 123 – x1 = 123 – (123 – √ (123 ^ 2 – 4 * A)) / 2) = (123 + √ (123 ^ 2 – 4 * A)) / 2 = x2,
y2 = 123 – x2 = 123 – (123 + √ (123 ^ 2 – 4 * A)) / 2 = (123 – √ (123 ^ 2 – 4 * A)) / 2 = x1.
Thus, the required terms:
x = (123 – √ (123 ^ 2 – 4 * A)) / 2,
y = (123 + √ (123 ^ 2 – 4 * A)) / 2.
Note that a necessary condition for the existence of a decomposition into terms is:
D> = 0,
123 ^ 2 – 4 * A> = 0,
A <= 123 ^ 2/4.