Nasdaq interview question

Technical question on finding prime numbers