code: def add(idxi, idxj, dim):
      
      idxm = numpy.array(multi_index(idxi, dim))
      idxn = numpy.array(multi_index(idxj, dim))
      out = single_index(idxm + idxn)
      return out
docs: Bertran addition.
  
      Example
      -------
      >>> print(chaospy.bertran.add(3, 3, 1))
      6
      >>> print(chaospy.bertran.add(3, 3, 2))
      10