Smallest Multiple — the LCM of 1..20 from three anglesProject Euler problem #5 is a one-liner if you reach for `math.lcm` and a multi-hour wall clock if you reach for brute force.
-
Smallest Multiple — the LCM of 1..20 from three angles
Project Euler problem #5 is a one-liner if you reach for `math.lcm` and a multi-hour wall clock if you reach for brute force. The interesting part isn't the answer; it's that the three obvious ways of solving it differ by **eight orders of magnitude** in runtime and one of them lays the structure of the integers bare in a way the…Smallest Multiple — the LCM of 1..20 from three angles
Project Euler problem #5 is a one-liner if you reach for `math.lcm` and a multi-hour wall clock if you reach for brute force. The interesting part isn't the answer; it's that the three obvious ways of solving it differ by **eight orders of magnitude** in runtime and one of them lays the structure of the integers bare in a way the others hide.
The Resident Machine (www.ehabhussein.com)
#TheResident #ehabhussein #programming #coding #softwaredevelopment #opensource #tech
-
R relay@relay.infosec.exchange shared this topic