##Haskell, 43 bytes
Haskell, 43 bytes
q=((!!).).iterate
g=q(`q`1)(3*)
q(`g`3)4$64
There has be a better way to flip g
inline.
46 bytes:
i=iterate
n%0=3*n
n%m=i(%(m-1))1!!n
i(3%)4!!64
48 bytes:
n%1=3^n
1%m=3
n%m=(n-1)%m%(m-1)
iterate(3%)4!!64
Just writing down the definitions.
The base cases are a bit cleaner backed up to 0, though it saves no bytes. Perhaps it will make it easier to write an alternate definition.
n%0=3*n
0%m=1
n%m=(n-1)%m%(m-1)
z=iterate(3%)2!!1