I have the below recurrence: \begin{align} T(n, 1) &= 3n \\ T(1, m) &= 3m \\ T(n, m) &= 3n + T(\tfrac{n}{3}, \tfrac{m}{3}) \end{align}
How to get a tight asymptotic bound for $T(n, n^2)$ assuming that $n$ is a power of 3?
Using the substitution method for $T(m,n)$, I get a very weird relation:
$$T(n,m) = 3n + \frac{m}{3^{k-1}} + n\left(3 - \frac{1}{3^{k-1}}\right),$$ where $k = \log_3 n$.
Any suggestion would be helpful.