<s>[INST] def calculate_prime_factors(n):
    """Returns a dictionary with the prime factors of a number as keys and their powers as values."""
    i = 2
    factors = {}
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors[i] = factors.get(i, 0) + 1
    if n > 1:
        factors[n] = factors.get(n, 0) + 1
    return factors

def solve(n):
    """Finds the smallest number that is a multiple of all numbers from 1 to n."""
    factors = {}
    for i in range(1, n+1):
        factors_of_i = calculate_prime_factors(i)
        for factor, power in factors_of_i.items():
            factors[factor] = max(factors.get(factor, 0), power)
    result = 1
    for factor, power in factors.items():
        result *= factor ** power
    return result[/INST]