input = 61 Sm = 0 Sn = 1 while sum([int(x) for x in str(Sn)]) != input: Sm, Sn = Sn, Sm+Sn print(Sn)