Project Euler #5: Smallest multiple

  • + 0 comments
    t = int(input().strip())
    for a0 in range(t):
        n = int(input().strip())
        should_con = False
        ans = 0
        for num in range(n, n ** 5 + 1):
            for i in range(1, n + 1):
                if num % i == 0:
                    should_con = True
                else:
                    should_con = False
                    break
            if should_con:
                ans = num
                break
        print(ans)