The goal is to show that $$\left(\frac{1}{3}\right)^kn=1 \Rightarrow k = \log_3 n\,.$$
So I started with $\left(\frac{1}{3}\right)^kn=1 \Leftrightarrow \left(\frac{1}{3}\right)^k=\frac{1}{n}$ in order to use the identity $y=a^x \Leftrightarrow x=\log_a y$, which then yields $$k=\log_{1/3} \frac{1}{n}$$ which using $\log \frac{1}{x}=-\log a$ can be written as $$k = -\log_{1/3} n\,.$$ But that is not what I wanted to show, as $\log_3 n \neq -\log_{1/3} n$.
I don't know where the mistake is.