User blog comment:Hyp cos/tree function and TREE(3)/@comment-5029411-20140624173620/@comment-5529393-20140625071335

You appear to be evaluating ordered trees rather than unordered trees. It looks mostly right, except ((())) should be w^{w^{w^{w^w}}} rather than w^{w^{w^w}}, and () should be just phi(1,0,0,0,0), not phi(1,0,0,0,0,0). (You don't go up by two each time, just from () to (). )