iteration over second index is only performed for element which order of magnitude would satisfy O(number) = O(first prime) + O(second prime)