Prints out all prime numbers up to a given input