def hypersimp(f, k):
    f = sympify(f)

    g = f.subs(k, k + 1) / f

    g = g.rewrite(gamma)
    g = expand_func(g)
    g = powsimp(g, deep=True, combine='exp')

    if g.is_rational_function(k):
        return simplify(g, ratio=S.Infinity)
    else:
        return None
Given combinatorial term f(k) simplify its consecutive term ratio
dataset/ETHPy150Open sympy/sympy/sympy/simplify/simplify.py/hypersimp