efficient algo for nth prime is added