Determine
four distinct nonnegative integers A,
B,
C, and
D that satisfy this equation:
2A + 3B + 7C + 12D = 2021
*** For an extra challenge, solve this puzzle without using a computer program/excel solver assisted method.
(A,B,C,D) = (0, 5, 2, 3)
1 + 243 + 49 + 1728 = 2021
------
import math
for A in range(1+int(math.log(2021,2))):
for B in range(1+int(math.log(2021,3))):
for C in range(1+int(math.log(2021,7))):
for D in range(1+int(math.log(2021,12))):
if 2**A + 3**B + 7**C + 12**D == 2021:
print(A,B,C,D)
print(2**A , 3**B , 7**C , 12**D)
|
Posted by Larry
on 2023-04-05 10:11:54 |