7:07 PM
@user21820 I have analyzed your program.
It is quite clever; your p(n) has a growth rate similar to f_{zeta_0 * omega}(n) in the fast-growing herarchy.
This is nowhere near the Buchholz hydra though; even the 0-1 Buchholz hydra has a growth rate similar to F_BHO(n), where BHO is the Bachmann-Howard ordinal.
The way it works is: just like the Kirby-Paris hydra, a node labelled with 0 with children corresponding to ordinals alpha_1,...,alpha_n will correspond to the ordinal omega^(alpha_1 + ... + alpha_n)
So a root node labelled with [0] will correspond to epsilon_0
then, a root node labelled with 0 with n children that are childless nodes labelled with [0] will correspond to epsilon_0 * n
then a root node with a single child being the previous tree will correspond to omega^{epsilon_0 * n}
then omega^omega^{epsilon_0 * n}, and so on
so a root node labelled with [[0],0] will correspond to epsilon_1
in general, a node labelled with a tree corresponding to the ordinal alpha will correspond to the ordinal epsilon_alpha
so a root node with label a root node with label [0] will correspond to epsilon_epsilon_0
a root node with label the previous tree will correspond to epsilon_epsilon_epsilon_0
and the limit of S-trees is zeta_0
This is 0-reduction; 1-reduction will also correspond to an ordinal hierarchy of length zeta_0, except the base function is about f_{zeta_0}(n). So the limit of 1-reduction is f_{zeta_0 * 2}(n).
p(n) will then be about f_{zeta_0 * n}(n).
Unfortunately, the proof of well-ordering at the bottom of your program, cannot work, because the ordering you define is not well-ordered.
For example, if we let A-B-C-D be a tree with root node labelled with A, with a child with label B, with a child with label C, etc.
Then [0], 0-[0], 0-0-[0], 0-0-0-[0], ... will be an infinite sequence that is decreasing according to your ordering.