Skip to content

Instantly share code, notes, and snippets.

@shieldsd
Created March 13, 2012 10:50
Show Gist options
  • Save shieldsd/2028103 to your computer and use it in GitHub Desktop.
Save shieldsd/2028103 to your computer and use it in GitHub Desktop.
Project Euler #5
def gcd(i, j):
while j:
i, j = j, i % j
return i
def lcm(i, j):
return i * j / gcd(i, j)
print reduce(lcm, range(1, 21))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment