Improving performance in checking prime numbers

Sure, but that’s not what the OP asked for, and I don’t know anything about algorithmic improvements to the OP’s code anyways. :slight_smile: