You've identified it!
A couple notes. Since numbers grow extremely there's some limit as
you noticed. I admit it was unfair that I didn't define the domain
of the function, but you got it anyway. I could of course have had
a condition added to make life easier, e.g. $_&&!/[^0-9]/ { ... }
or, to obfuscate it a bit, even _=int(sqrt(-($_*-$_))) { ... } .
The two constant parameters are indeed 1 and 0 (not the values you
assumed in an earlier post). I used a reduced pattern of what I saw
in your other thread's post (_^_^_^...^_) for these constants (with
my observation that the reduced subexpression toggles between 0 and
1). The function is the one you suspected, and (in obfuscated form)
simpler written as just
# defined for integer args>0
func __(_) { return _>2?__(--_)+__(--_):1 } { print __($_) }
I like this form even more (with those nasty --_ side effects) and
the underlying mathematical function is more obvious, but the time
complexity is extremely bad since we have a cascading recursion in
that simple form. There's a transformation of the function possible
to generate an equivalent linear recursion with good (linear) time
complexity (and no supporting arrays and the like), and that is
func ___(_) { return __(_,x^x,x^x^x) }
func __(_,_x,x_) { return --_?__(_,x_,_x+x_):_x+x_ }
$_&&!/[^0-9]/ { print ___($_) }
And where the first version is rarely usable for arguments >35 the
second one runs smoothly for large arguments in no time.
Janis