How is $2^{\log_4 n}= n^{\log _42}$?
Take the logarithm in base $4$: \begin{align} &\mathrm{(LHS)} & \log_4(2^{\log_4n})=(\log_4n)(\log_42) \\ &\mathrm{(RHS)} & \log_4(n^{\log_42})=(\log_42)(\log_4n) \end{align} Since the logarithms are equal, the numbers are equal.