def primefactors(n, limit=None, verbose=False):
 n = int(n)
 factors = sorted(factorint(n, limit=limit, verbose=verbose).keys())
 s = [f for f in factors[:(-1):None] if (f not in [(-1), 0, 1])]
 if (factors and isprime(factors[(-1)])):
  s += [factors[(-1)]]
 return s

def primefactors ( n , limit = None , verbose = False ) : n = int ( n ) factors = sorted ( factorint ( n , limit = limit , verbose = verbose ) . keys ( ) ) s = [ f for f in factors [ : ( - 1 ) : None ] if ( f not in [ ( - 1 ) , 0 , 1 ] ) ] if ( factors and isprime ( factors [ ( - 1 ) ] ) ) : s += [ factors [ ( - 1 ) ] ] return s
return a sorted list of ns prime factors .