sqrt prime check speedup