Dassault Systèmes interview question

write optimised code for prime numbers