I think there is still room for improvment in that mayan table - somehow getting rid of that 3rd $var - but I can't wrap my mind around it. Or shrinking that mayan string somehow and adding some math-magic - idk . Or something totally new and radical more like.

In terms of the recursive - I did try it "both ways" (to and from at same time) ... and it does work - but I found the overhead on the string side to be too big - but then, that was a few days ago ... one might revisit a double-recurse.