Applied Materials interview question

Output all prime numbers up until input n