Hydra function

The Hydra function is a Collatz-like function defined as: It is named as such due its connection to the unsolved halting problems for the Cryptids Hydra and Antihydra. Due to its simplicity, simulations for both of these Turing machines utilize this function instead of what can initially be proven.
Relationship to Hydra and Antihydra
Recall the high-level rules for Hydra and Antihydra:
| Hydra | Antihydra |
|---|---|
| Let : | Let : |
Already, both machines appear to have very similar functions. They have one parameter that increases exponentially with growth factor and another that effectively takes a pseudo-random walk. This relationship can be strengthened through a modification of the rules. Below, the exponentially increasing variables are described by integer sequences:
| Hydra | Antihydra |
|---|---|
Doing this makes illustrating the transformation easier. Now we will define a new integer sequence based on the old one and discover the recursive rules for that sequence. This new sequence is and for Hydra and Antihydra respectively. We start by using instead and substituting for its recursive formula. By doing so, we get:
| Hydra | Antihydra |
|---|---|
After that, we can substitute for its solution in terms of . What results is the following:
| Hydra | Antihydra |
|---|---|
We note that the if statements simplify to checking if is even or odd. After simplifying, we are done:
| Hydra | Antihydra |
|---|---|
Now that we have demonstrated a strong similarity in the behaviour of both Turing machines, we can return to using the high-level rules. Once we do that and update the step counts, the result is:
| Hydra | Antihydra |
|---|---|
| Let : | Let : |
Properties
The Hydra function can be rewritten as follows: From this comes a way to slightly optimize the calculation. Here, and are positive integers with odd. Let be an integer and is the th iterate of .