plumial.core.P._P.d

_P.d()[source]

Return the d-polynomial or its evaluation.

Return type:

Union[Expr, int, float, Rational]

Returns:

Difference polynomial h^e - g^o, either symbolic or evaluated

Examples

>>> p = P(133)
>>> p.d()  # Symbolic form
h**5 - g**2
>>> collatz_p = P(133).encode(B.Collatz)
>>> collatz_p.d()  # Uses basis automatically
23