loading
open in
main.py
1
2
3
4
5
6
7
from Euler import prime_sieve
from math import log
from operator import mul

L = int(input('Smallest number that is evenly divisible by all of the numbers from 1 to? '))
primes = prime_sieve(L)
print "is", reduce(mul, (p ** int(log(L)/log(p)) for p in primes), 1)
Python 2.7.10 (default, Jul 14 2015, 19:46:27) [GCC 4.8.2] on linux