Calling function gen ( ) to generate ' k ' number of terms
res = gen ( k , res ) NEW_LINE k += 1 NEW_LINE j = len ( res ) - 1 NEW_LINE while j != n and j + k > n : NEW_LINE INDENT k -= 1 NEW_LINE DEDENT