Find the prime factors
sqt = ( int ( math . sqrt ( k ) ) ) NEW_LINE for i in range ( 2 , sqt + 1 ) : NEW_LINE INDENT while ( k % i == 0 ) : NEW_LINE INDENT factors . append ( i ) NEW_LINE k //= i NEW_LINE DEDENT DEDENT if ( k > 1 ) : NEW_LINE INDENT factors . append ( k ) NEW_LINE DEDENT