Estimating the bit operations using big O notation
There are several problems. First, the time complexity of multiplying two k-bit numbers is much less than O(k^2). More like O(k log k). Since this is an important open research problem, you usually assume it is O(M(k)) for some function M and use that further.
Second, you are not multiplying two k bit numbers. You are multiplying one k-bit number by 3, which is done easily in O(k). This would get you a total of O(n^2).
Third, that’s not a clever method to calculate $3^n$. Much better is repeated squaring/multiplying. For example to calculate $3^{100}$: Start with 3, square, multiply by 3, square, square, square, multiply by 3, square, square. Since the number of bits starts small and doubles every time, this works in O(M(n)).