When asked about the ages of her three children, Mrs. Arithmetic replied to Mrs. Algebra in the following manner:
"The sum of the ages of my children is precisely 3 times that of Alec who is 3 years younger than Laura. The cube of Laura's age together with the square of Alec's age plus Karl's age make up a multiple of 100"
Determine the ages of the three children if Alec is still in his twenties.
clc
for laura = 4:150
alec=laura-3;
% alec+laura+karl=3*alec
karl=2*alec-laura;
testSum=laura^3+alec^2+karl;
if testSum/100==round(testSum/100)
disp([alec laura karl testSum])
end
end
finds
Alec Laura Karl L^3+A^2+K
8 11 5 1400
18 21 15 9600
28 31 25 30600
38 41 35 70400
44 47 41 105800
48 51 45 135000
58 61 55 230400
68 71 65 362600
78 81 75 537600
88 91 85 761400
94 97 91 921600
98 101 95 1040000
108 111 105 1379400
118 121 115 1785600
128 131 125 2264600
138 141 135 2822400
144 147 141 3197400
of which only
Alec = 28, Laura = 31, Karl = 25 satisfies Alec being in his twenties.
|
Posted by Charlie
on 2022-07-05 13:11:05 |