Skip to content

Instantly share code, notes, and snippets.

@karthikbgl
Created October 24, 2015 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karthikbgl/22754cffa02313fb10cb to your computer and use it in GitHub Desktop.
Save karthikbgl/22754cffa02313fb10cb to your computer and use it in GitHub Desktop.
Find smallest multiple
import fractions
def smallest_multiple( n):
return reduce(lambda x, y: x*y/fractions.gcd(x, y), range(2, n+1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment