[Project Euler Problem 5]Smallest multiple

2015. 7. 16. 02:23
def isprime(x):
    r = int(sqrt(x))
    if x%2 == 0 and x>2:
        return 0
    for i in range(3, r+1, 2):
        if x%i == 0:
            return 0
    return 1

def howmany(a, b):
    i = 0
    r = a
    while r

Problem 3에서 만든 isprime함수 재활용


Algorithm/Project Euler