Trivial approach (i.e. calculating actual powers) will lead to numbers so huge they will take forever to calculate, and/or will eat up all available memory. Gotta put more thought into this kata.
I think people won't be willing to share the exact way to resolve it :) but for what it's worth, I was able to solve the kata with some analysis with pen and paper. You need a couple of "layers" of powers to hopefully see the pattern to emerge.
You could also try the easier, similar kata (linked in the description) if you did not solve it yet. General approach is very similar, just generalized a bit.
This comment is hidden because it contains spoiler information about the solution