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.
Alex is 28, Karl is 25, Laura is 31
A, L, K
A + L + K = 3A
A + 3 = L
A = L-3
L^3 + A^2 + K = 100n
A = L-3 **********
K = 2A - L
K = 2(L-3) - L
K = L-6 **********
Let A = a
So (K,A,L) = (a-3,a,a+3)
(a+3)^3 + a^2 + (a-3) = 100n
a^3 + 10a^2 + 28a + 24 = 100n
Since Alex = a and is in his twenties just check 20 <= a < 30
--------------------------
def age_function(a):
return a**3 + 10*a**2 + 28*a + 24
for a in range(20,30):
if age_function(a)%100 == 0:
print(a,age_function(a))
OUTPUT: 28 30600
So Alex is 28, Karl is 25, Laura is 31
|
Posted by Larry
on 2022-07-05 19:05:59 |