Find all tuples of positive integers (a,b,c) such that lcm(a,b,c)=(ab+bc+ca)/4.
I found only one solution: (a,b,c) = (1,2,2) with LCM=2
for a,b,c up to 300
(I assumed WLOG that a <= b <= c)
Output: 1 2 2 and the LCM is: 2
Program (Python):
def myLCM(*integers): # the '*' allows any number of inputs
""" input integers separated by commas; output is the Least Common Multiple """
from math import gcd
ans = 1
for ar in integers:
ans = abs(ans*ar) // gcd(ans,ar)
return ans
big = 300
for a in range(1,big):
for b in range(a,big):
for c in range(b,big):
if myLCM(a,b,c) == (a*b+b*c+c*a)/4:
print(a,b,c, 'and the LCM is:', myLCM(a,b,c))
|
Posted by Larry
on 2020-11-26 10:16:36 |