Prasanna Meda wrote: > - Folded all three root checkings for 3, 5 and 7 into one loop. > - Short cut the loop with 3**n < 5 **n < 7**n logic. > - Even numbers can be ruled out. Without going to that complicated path, the better performance is achieved with just reordering of the tests from 3,5,7 to 7,5.3, so that average case becomes better. This is more simpler than folding patch. Thanks, Prasanna.