Pergunta de entrevista da empresa ShipperHQ

How would you write a function that inputs an integer and outputs the prime numbers from 2 to N?