Algorithm to list all primes up to n: list 2..n, then repeatedly take the smallest unmarked number as prime and mark its multiples.. This concept is typically introduced in College. Understanding this concept builds a strong foundation for more advanced mathematics.