class_docstr: The Recurrence Operators are defined by a list of polynomials
  in the base ring and the parent ring of the Operator.
  
  Explanation
  ===========
  
  Takes a list of polynomials for each power of Sn and the
  parent ring which must be an instance of RecurrenceOperatorAlgebra.
  
  A Recurrence Operator can be created easily using
  the operator `Sn`. See examples below.
  
  Examples
  ========
  
  >>> from sympy.holonomic.recurrence import RecurrenceOperator, RecurrenceOperators
  >>> from sympy import ZZ
  >>> from sympy import symbols
  >>> n = symbols('n', integer=True)
  >>> R, Sn = RecurrenceOperators(ZZ.old_poly_ring(n),'Sn')
  
  >>> RecurrenceOperator([0, 1, n**2], R)
  (1)Sn + (n**2)Sn**2
  
  >>> Sn*n
  (n + 1)Sn
  
  >>> n*Sn*n + 1 - Sn**2*n
  (1) + (n**2 + n)Sn + (-n - 2)Sn**2
  
  See Also
  ========
  
  DifferentialOperatorAlgebra
class_docstr_tok: ["The","Recurrence","Operators","are","defined","by","a","list","of","polynomials","in","the","base","ring","and","the","parent","ring","of","the","Operator",".","Explanation","===========","Takes","a","list","of","polynomials","for","each","power","of","Sn","and","the","parent","ring","which","must","be","an","instance","of","RecurrenceOperatorAlgebra",".","A","Recurrence","Operator","can","be","created","easily","using","the","operator","`","Sn","`",".","See","examples","below",".","Examples","========",">",">",">","from","sympy.holonomic.recurrence","import","RecurrenceOperator",",","RecurrenceOperators",">",">",">","from","sympy","import","ZZ",">",">",">","from","sympy","import","symbols",">",">",">","n","=","symbols","(","'n","'",",","integer=True",")",">",">",">","R",",","Sn","=","RecurrenceOperators","(","ZZ.old_poly_ring","(","n",")",",","'Sn","'",")",">",">",">","RecurrenceOperator","(","[","0",",","1",",","n","*","*","2","]",",","R",")","(","1",")","Sn","+","(","n","*","*","2",")","Sn","*","*","2",">",">",">","Sn","*","n","(","n","+","1",")","Sn",">",">",">","n","*","Sn","*","n","+","1","-","Sn","*","*","2","*","n","(","1",")","+","(","n","*","*","2","+","n",")","Sn","+","(","-n","-","2",")","Sn","*","*","2","See","Also","========","DifferentialOperatorAlgebra"]
docstr: Multiplies two Operators and returns another
  RecurrenceOperator instance using the commutation rule
  Sn * a(n) = a(n + 1) * Sn
docstr_tok: ["Multiplies","two","Operators","and","returns","another","RecurrenceOperator","instance","using","the","commutation","rule","Sn","*","a","(","n",")","=","a","(","n","+","1",")","*","Sn"]
code: def __mul__(self, other):
      """
      Multiplies two Operators and returns another
      RecurrenceOperator instance using the commutation rule
      Sn * a(n) = a(n + 1) * Sn
      """
  
      listofself = self.listofpoly
      base = self.parent.base
  
      if not isinstance(other, RecurrenceOperator):
          if not isinstance(other, self.parent.base.dtype):
              listofother = [
                  self.parent.base.from_sympy(sympify(other))
              ]
  
          else:
              listofother = [other]
      else:
          listofother = other.listofpoly
      # multiply a polynomial `b` with a list of polynomials
  
      def _mul_dmp_diffop(b, listofother):
          if isinstance(listofother, list):
              sol = []
              for i in listofother:
                  sol.append(i * b)
              return sol
          else:
              return [b * listofother]
  
      sol = _mul_dmp_diffop(listofself[0], listofother)
  
      # compute Sn^i * b
      def _mul_Sni_b(b):
          sol = [base.zero]
  
          if isinstance(b, list):
              for i in b:
                  j = base.to_sympy(i).subs(
                      base.gens[0], base.gens[0] + S.One
                  )
                  sol.append(base.from_sympy(j))
  
          else:
              j = b.subs(base.gens[0], base.gens[0] + S.One)
              sol.append(base.from_sympy(j))
  
          return sol
  
      for i in range(1, len(listofself)):
          # find Sn^i * b in ith iteration
          listofother = _mul_Sni_b(listofother)
          # solution = solution + listofself[i] * (Sn^i * b)
          sol = _add_lists(
              sol, _mul_dmp_diffop(listofself[i], listofother)
          )
  
      return RecurrenceOperator(sol, self.parent)
  
imports: from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.printing import sstr
  from sympy.core.sympify import sympify
label_desc: Use image node_id 2 for calling the RecurrenceOperator obj's underlying member method code with example usage: obj.__mul__(other) and returns: RecurrenceOperator, sol, sol, list