def dup_zz_cyclotomic_poly(n, K):
 h = [K.one, (- K.one)]
 for (p, k) in factorint(n).items():
  h = dup_quo(dup_inflate(h, p, K), h, K)
  h = dup_inflate(h, (p ** (k - 1)), K)
 return h

def dup_zz_cyclotomic_poly ( n , K ) : h = [ K . one , ( - K . one ) ] for ( p , k ) in factorint ( n ) . items ( ) : h = dup_quo ( dup_inflate ( h , p , K ) , h , K ) h = dup_inflate ( h , ( p ** ( k - 1 ) ) , K ) return h
efficiently generate n-th cyclotomic polnomial .