code: def hypersimp(f, k):
      """Given combinatorial term f(k) simplify its consecutive term ratio
      i.e. f(k+1)/f(k).  The input term can be composed of functions and
      integer sequences which have equivalent representation in terms
      of gamma special function.
  
      Explanation
      ===========
  
      The algorithm performs three basic steps:
  
      1. Rewrite all functions in terms of gamma, if possible.
  
      2. Rewrite all occurrences of gamma in terms of products
         of gamma and rising factorial with integer,  absolute
         constant exponent.
  
      3. Perform simplification of nested fractions, powers
         and if the resulting expression is a quotient of
         polynomials, reduce their total degree.
  
      If f(k) is hypergeometric then as result we arrive with a
      quotient of polynomials of minimal degree. Otherwise None
      is returned.
  
      For more information on the implemented algorithm refer to:
  
      1. W. Koepf, Algorithms for m-fold Hypergeometric Summation,
         Journal of Symbolic Computation (1995) 20, 399-417
      """
      f = sympify(f)
  
      g = f.subs(k, k + 1) / f
  
      g = g.rewrite(gamma)
      if g.has(Piecewise):
          g = piecewise_fold(g)
          g = g.args[-1][0]
      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
  
imports: from collections import defaultdict
  from sympy.concrete.products import Product
  from sympy.concrete.summations import Sum
  from sympy.core import Basic, S, Add, Mul, Pow, Symbol, sympify, expand_func, Function, Dummy, Expr, factor_terms, expand_power_exp, Eq
  from sympy.core.exprtools import factor_nc
  from sympy.core.parameters import global_parameters
  from sympy.core.function import expand_log, count_ops, _mexpand, nfloat, expand_mul, expand
  from sympy.core.numbers import Float, I, pi, Rational
  from sympy.core.relational import Relational
  from sympy.core.rules import Transform
  from sympy.core.sorting import ordered
  from sympy.core.sympify import _sympify
  from sympy.core.traversal import bottom_up, walk
  from sympy.functions import gamma, exp, sqrt, log, exp_polar, re
  from sympy.functions.combinatorial.factorials import CombinatorialFunction
  from sympy.functions.elementary.complexes import unpolarify, Abs, sign
  from sympy.functions.elementary.exponential import ExpBase
  from sympy.functions.elementary.hyperbolic import HyperbolicFunction
  from sympy.functions.elementary.integers import ceiling
  from sympy.functions.elementary.piecewise import Piecewise, piecewise_fold, piecewise_simplify
  from sympy.functions.elementary.trigonometric import TrigonometricFunction
  from sympy.functions.special.bessel import BesselBase, besselj, besseli, besselk, bessely, jn
  from sympy.functions.special.tensor_functions import KroneckerDelta
  from sympy.integrals.integrals import Integral
  from sympy.matrices.expressions import MatrixExpr, MatAdd, MatMul, MatPow, MatrixSymbol
  from sympy.polys import together, cancel, factor
  from sympy.polys.numberfields.minpoly import _is_sum_surds, _minimal_polynomial_sq
  from sympy.simplify.combsimp import combsimp
  from sympy.simplify.cse_opts import sub_pre, sub_post
  from sympy.simplify.hyperexpand import hyperexpand
  from sympy.simplify.powsimp import powsimp
  from sympy.simplify.radsimp import radsimp, fraction, collect_abs
  from sympy.simplify.sqrtdenest import sqrtdenest
  from sympy.simplify.trigsimp import trigsimp, exptrigsimp
  from sympy.utilities.decorator import deprecated
  from sympy.utilities.iterables import has_variety, sift, subsets, iterable
  from sympy.utilities.misc import as_int
  import mpmath
label_desc: Use image node_id 5 for calling a global function with example usage: hypersimp(f, k) and returns: simplify, None