Did brute force, but earlier drafts of the code failed to exit the while loop correcly. By manual testing, an odd number is required in reg a to set the first output to 0 (for my puzzle input at least). Hence, only odd numbers are tested.