Find all possible integer solutions that satisfy this system of equations:
a+b+c=1
a3+b3+c2=1
If b = -a and c = 1, the equation is true, for any a. The program excludes these cases.
for a=-3000:3000
for b=a:3000
for c=-3000:3000
if a+b+c==1
if a^3+b^3+c^2==1
if c~=1 || a~=-b
disp([a b c])
end
end
end
end
end
end
finds
-3 -2 6
-2 0 3
0 1 0
by making b at least as large as a, with which it's interchangeable, so
all the possibilities in this range are:
-3 -2 6
-2 -3 6
-2 0 3
0 -2 3
0 1 0
1 0 0
plus the cases where c=1 and b=-a for any a.
Edited on October 1, 2023, 9:53 am
|
Posted by Charlie
on 2023-10-01 08:28:41 |