My original intuition about the "repeat original values" aspect of this problem is that it served as a safety net in case the bytes never reach zero simultaneously. When the original values repeat, it starts over and the same sequence of numbers would be generated the second time around, once again missing zero.
Wrong! Here's a simple counter-example that one can hand simulate for better understanding:
./running 000000000000000000000000ffffff00 00000000000000000000000000000001 00000000000000000000000000000001
It repeats the input on cycles 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560 and 2816. Then on cycle 3072 it reaches all zeros for the first time. (The correct solution on this input would be 256.)
The moral: If you find a zero, don't report it as the solution until you're sure that the bytes do not repeat their initial state on an earlier cycle.
- Rick


