'Note: i counts from zero!'

def __init__(self, ap, bq, i, z):

    (ap, bq, i) = list(map(sympify, [ap, bq, i]))
    self._ap = ap
    self._bq = bq
    self._i = i
    ap = list(ap)
    bq = list(bq)
    bi = (bq.pop(i) + 1)
    if (bi == 0):
        raise ValueError('Cannot    increment    -1    lower    index.')
    m = Poly((_x * (bi - 1)), _x)
    for b in bq:
        m *= Poly(((_x + b) - 1), _x)
    B = Dummy('B')
    D = Poly(((((bi - 1) * B) - bi) + 1), B)
    n = Poly(z, B)
    for a in ap:
        n *= (D + a)
    b0 = n.nth(0)
    if (b0 == 0):
        raise ValueError('Cannot    increment    index:    cancels    with    upper')
    n = Poly(Poly(n.all_coeffs()[:(-1)], B).as_expr().subs(B, ((_x / (bi - 1)) + 1)), _x)
    self._poly = Poly(((m - n) / b0), _x)
