I need to calculate the sum of the lcm(i,j) when i and j go from 1 to k. k can be = to numbers as big as 10^10.
its like this : https://www.programmersought.com/article/86482143316/ but I need to do it in Python. This is the Equation
The way ive been doing is to use 2 for loops and calculate the lcm of i and j but it takes WAY too long. Thought there could be a faster mathematical way maybe.
Thank you
1.4m articles
1.4m replys
5 comments
56.9k users