Modified findNextPrime method to skip even values