def dup_deflate(f, K):
 if (dup_degree(f) <= 0):
  return (1, f)
 g = 0
 for i in range(len(f)):
  if (not f[((- i) - 1)]):
   continue
  g = igcd(g, i)
  if (g == 1):
   return (1, f)
 return (g, f[::g])

def dup_deflate ( f , K ) : if ( dup_degree ( f ) <= 0 ) : return ( 1 , f ) g = 0 for i in range ( len ( f ) ) : if ( not f [ ( ( - i ) - 1 ) ] ) : continue g = igcd ( g , i ) if ( g == 1 ) : return ( 1 , f ) return ( g , f [ : : g ] )
map x**m to y in a polynomial in k[x] .