def dup_euclidean_prs(f, g, K):
 prs = [f, g]
 h = dup_rem(f, g, K)
 while h:
  prs.append(h)
  (f, g) = (g, h)
  h = dup_rem(f, g, K)
 return prs

def dup_euclidean_prs ( f , g , K ) : prs = [ f , g ] h = dup_rem ( f , g , K ) while h : prs . append ( h ) ( f , g ) = ( g , h ) h = dup_rem ( f , g , K ) return prs
euclidean polynomial remainder sequence in k[x] .