#PHP, 114 bytes
PHP, 114 bytes
ignore the line breaks; they are for readability only.
function u($n,$m){return$m>1&$n>1?u(u($n-1,$m),$m-1):3**$n;}
function g($x){return u(3,$x>1?g($x-1):4);}
echo g(63);
It is possible to integrate the second case into the first one: for n=1
, 3^n
equals 3
.
This will save a few bytes on - as far as I can see - all existing answers; saved two bytes on my
previous version, 62+43+11=116 bytes
function u($n,$m){return$m>1?$n>1?u(u($n-1,$m),$m-1):3:3**$n;}
PHP´s left associativity of the ternary requires parentheses ... or a specific order of tests.
This saved two bytes on the parenthesized expression.
There is probably an iterative approach, which may allow further golfing ...
but I can´t take the time for it now.