You need to check whether a number is a power of three or not.
but, what you did was to check whether a number is a multiplication of three or not.

An integer n is a power of three, if there exists an integer x such that ( n == 3^{x} )

And an integer n is a multipliation of three, if n is the result of multiplying 3 by another whole number x such that ( n == 3 * x ) (way of checking if the remainder is 0)

So trying your code with 45 will return true cause 45 = 3 * 15

27 will return true ( 27 = 3 * 9 )
11 will return false ( there is no integer value for x so that 11 = 3 * x )
10 will return false ( same as 11 )