Project Euler #5: Smallest multiple

  • + 0 comments

    Python 3:

    #!/bin/python3
    
    import sys
    
    def isDivisibleByAllNNumbers(num, n):
        for i in range(1, n+1):
            if (num % i != 0):
                return False
        return True
    
    
    t = int(input().strip())
    for a0 in range(t):
        n = int(input().strip())
        
        x = 1
        while not isDivisibleByAllNNumbers(x, n):
            x += 1
            
        print(x)