Task: Program Execution
Input (English): 291, k, 359, n, x
Output (English): 1, 2, 3, 5, 9