# Solving a system of equations and inequalities with 5 variables

For the formula:

(a/210)*0 + (b/210)*1 + (c/210)*2 + (d/210)*3 + (e/210)*4 = 1/2 + 1/3 + 1/5 + 1/7,

where 0<=a,b,c,d,e<=210,

and a+b+c+d+e=210,

how can I find all solutions for a,b,c,d,e?

The result depends on the domain of variables.

Reduce[(a/210)*0 + (b/210)*1 + (c/210)*2 + (d/210)*3 + (e/210)*4 ==
1/2 + 1/3 + 1/5 + 1/7 && 0 <= {a, b, c, d, e} <= 210 &&
a + b + c + d + e == 210 && d <= e, {a, b, c, d, e}, Reals]


((a == 0 && ((b == 173 && c == 37 && d == 0) || (173 < b <= 976/5 && 1/3 (976 - 5 b) <= c <= 1/2 (593 - 3 b) && d == 593 - 3 b - 2 c) || (976/5 < b < 593/3 && 0 <= c <= 1/2 (593 - 3 b) && d == 593 - 3 b - 2 c) || (b == 593/3 && c == 0 && d == 0))) || (0 < a <= 173/ 2 && ((b == 173 - 2 a && c == 1/3 (976 - 7 a - 5 b) && d == 593 - 4 a - 3 b - 2 c) || (173 - 2 a < b < 1/5 (976 - 7 a) && 1/3 (976 - 7 a - 5 b) <= c <= 1/2 (593 - 4 a - 3 b) && d == 593 - 4 a - 3 b - 2 c) || (1/5 (976 - 7 a) <= b < 1/3 (593 - 4 a) && 0 <= c <= 1/2 (593 - 4 a - 3 b) && d == 593 - 4 a - 3 b - 2 c) || (b == 1/3 (593 - 4 a) && c == 0 && d == 593 - 4 a - 3 b))) || (173/2 < a <= 976/ 7 && ((0 <= b < 1/5 (976 - 7 a) && 1/3 (976 - 7 a - 5 b) <= c <= 1/2 (593 - 4 a - 3 b) && d == 593 - 4 a - 3 b - 2 c) || (1/5 (976 - 7 a) <= b < 1/3 (593 - 4 a) && 0 <= c <= 1/2 (593 - 4 a - 3 b) && d == 593 - 4 a - 3 b - 2 c) || (b == 1/3 (593 - 4 a) && c == 0 && d == 593 - 4 a - 3 b))) || (976/7 < a <= 593/ 4 && ((0 <= b < 1/3 (593 - 4 a) && 0 <= c <= 1/2 (593 - 4 a - 3 b) && d == 593 - 4 a - 3 b - 2 c) || (b == 1/3 (593 - 4 a) && c == 0 && d == 593 - 4 a - 3 b)))) && e == 1/4 (247 - b - 2 c - 3 d)

describes an infinite set of the solutions over the reals. The same description for the rationals. The command

FindInstance[(a/210)*0 + (b/210)*1 + (c/210)*2 + (d/210)*3 + (e/210)*4 ==
1/2 + 1/3 + 1/5 + 1/7 &&  0 <= {a, b, c, d, e} <= 210 &&
a + b + c + d + e == 210 &&  d <= e, {a, b, c, d, e}, Integers, 50000];
Dimensions[%]


{47988, 5}

produces a finite set of 47988 solutions over the integers.

• I tried another one with one more variable and ran out of RAM: x = 2310; FindInstance[(a/x)*0 + (b/x)*1 + (c/x)*2 + (d/x)*3 + (e/x)*4 + (f/ x)*5 == 1/2 + 1/3 + 1/5 + 1/7 + 1/11 && 0 <= {a, b, c, d, e, f} <= x && a + b + c + d + e + f == x && e <= f, {a, b, c, d, e, f}, Integers, 5000000]; Dimensions[%] Commented Apr 7 at 23:12