Use the same program as , replacing only its first line by a test for a final :If the input ends in , the loop erases it and eventually appends output . Every other input, including the empty word, follows the loop and produces . This is the characteristic function of .
Solved by gpt-5.6-sol high.
Codex Wiki