"""
Created on Tue May 26 01:03:55 2020
@author: vila
"""
def recassim(n0, n):
    i = 0      # succ index
    t = n0       # ith term
    sL = [n0]    # list of the first i terms
    while t != n:
        i += 1
        if t-i > 0 and not t-i in sL:
            t = t-i
        else:
            t = t+i
        sL.append(t)
    return i #, sL
