

def dup_primitive_prs(f, g, K):
    '\n    Primitive polynomial remainder sequence (PRS) in `K[x]`.\n\n    Examples\n    ========\n\n    >>> from sympy.polys import ring, ZZ\n    >>> R, x = ring("x", ZZ)\n\n    >>> f = x**8 + x**6 - 3*x**4 - 3*x**3 + 8*x**2 + 2*x - 5\n    >>> g = 3*x**6 + 5*x**4 - 4*x**2 - 9*x + 21\n\n    >>> prs = R.dup_primitive_prs(f, g)\n\n    >>> prs[0]\n    x**8 + x**6 - 3*x**4 - 3*x**3 + 8*x**2 + 2*x - 5\n    >>> prs[1]\n    3*x**6 + 5*x**4 - 4*x**2 - 9*x + 21\n    >>> prs[2]\n    -5*x**4 + x**2 - 3\n    >>> prs[3]\n    13*x**2 + 25*x - 49\n    >>> prs[4]\n    4663*x - 6150\n    >>> prs[5]\n    1\n\n    '
    prs = [f, K]
    (_, h) = dup_primitive(dup_prem(f, g, K), K)
    while h:
        prs.append(h)
        (f, g) = (g, h)
        (_, h) = dup_primitive(dup_prem(f, g, K), K)
    return prs

dataset/ETHPy150Open sympy/sympy/sympy/polys/euclidtools.py dup_primitive_prs/VarMisuse@21/414 `g`->`K`