Keep finding next trms of a sequence generated using digits of x until we either reach x or a number greate than x
next_term = 0 ; NEW_LINE i = n ; NEW_LINE while ( next_term < x ) : NEW_LINE INDENT next_term = 0 ; NEW_LINE DEDENT