Reduced number of factors looped through from 2 : num + 1 to 2 : sqrt(num)+1