<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add(idxi, idxj, dim):
 """ Bertran addition. Example ------- 6 10 """

    idxm = numpy.array(multi_index(idxi, dim))
    idxn = numpy.array(multi_index(idxj, dim))
    out = single_index(idxm + idxn)
    return out