User blog:Ubersketch/Nested Buchholz Hydras

So I decided to make nested Buchholz.

At each step, we perform a transformation on the tree with two parameters: a leaf node \(a\) and a nonnegative integer \(n\). We alter the hydra using the following rules: If \(a\) is the hydra's rightmost leaf, we notate the transformed tree as \(\alpha[n]\), where \(\alpha\) is the hydra.
 * 1) If \(a\) has no label, we proceed as in Kirby-Paris' game. Call the node's parent \(b\), and its grandparent \(c\) (if it exists). First we delete \(a\). If \(c\) exists (i.e. \(b\) is not the root), we make \(n\) copies of \(b\) and all its children and attach them to \(c\).
 * 2) If \(a\) has label \(#\), we go down the tree looking for a node \(b\) with label \(v \leq u\) (which is guaranteed to exist, as every child of the root node has label 0). Consider the subtree rooted at \(b\) — call it \(S\). Create a copy of \(S\), call it \(S'\). Within \(S'\), we relabel \(b\) with \(u\) and relabel \(a\) with \(0\). Back in the original tree, replace \(a\) with \(S'\).
 * 3) Else, if \(a\) has label \(\u\), we simply relabel \(a\) with \(u[n] + 1\).

Copy pasted from the article on Buchholz hydras.