from typing import Container


def generate_primes_v1(n: int) -> Container[int]:
    """Computes and returns all the primes up to 'n'.

    Args:
        n: The integer upto which all primes to be computed.

    Returns:
        All the primes upto 'n'.
    """

    primes = []
    is_prime = [False, False] + [True] * (n - 1)

    for i in range(2, n + 1):
        if is_prime[i]:
            primes.append(i)
            for p in range(2 * i, n + 1, i):
                is_prime[p] = False

    return primes