Even and odd, mutually

Back to the numbers from Part 1.

There, even was defined directly with % 2. Here is a definition that only looks at the previous number:

  • 0 is even.
  • N is even when N - 1 is odd, and odd when N - 1 is even.
even and odd are mutually recursive: each rule calls the other, so neither can be finished first.

They have to be built up together.