from typing import List


def is_prime(knownprimes: List[int], n: int) -> bool:
    """
    Checks if a number is prime using a List of known primes.
    """
    for p in knownprimes:
        if n % p == 0:
            return False
    return True