Dassault Systèmes Interview Question

write optimised code for prime numbers