if coeff is not S.Zero:
poly += coeff * Z**i
constants = []for z in roots(poly, Z).keys():
if z.is_zero:
continue
After Change
continue
recurr_coeffs = [polys[i].as_expr()*z**i for i in range(r + 1)]
if d == 0 and 0 != Add(*[recurr_coeffs[j]*j for j in range(1, r + 1)]):
// faster inline check (than calling rsolve_poly) for a// constant solution to a constant coefficient recurrence.
C = Symbol("C" + str(len(symbols)))