The algorithm Given a natural number $n$ define a procedure as follows:
- Generate a list of primes upto and possibly including, $n$
- Assign $Z = n$
- If $Z > 0$, subtract the largest prime from list which we haven't considered yet. Otherwise, add it to $Z$. If $n$ is prime, it is assumed accounted for by the first step.
- Repeat until all primes have been considered.
For example, take $25$. The list of primes would be $2, 3, 5, 7, 11, 13, 17, 19, 23$. Subtracting $23$ from $Z=25$, we get $Z=2$. Next, we get $Z=2-19= -17$. And so on. Consequently, $Z$ assumes the values $25, 2, -17, 0, 13, 2, -5, 0, 3, 1$.
_Note: Only an example. The conjecture as stated deals with applying the algorithms on primes. However, other numbers also seem to exhibit interesting patterns._
The Pattern
- Beginning at $3$ and every other prime thereafter, following the algorithm always (seems to) land us at $1$.
- For the rest of the primes, $Z$ has a final value of either $0$ or $2$.
The problem
Please read @alex.jordan's answer as he cleverly limits the range of values $Z$ can reach (say, terminal Z, or $Z_t$) to $\{-1,0,1,2\}$. As a result, the problem is now reduced to:
- For any prime number, prove that $-1$ cannot be a terminal.