n. Return True if n equals 3ᵏ for some integer k ≥ 0, and False otherwise.
Try to solve it without loops or recursion.n=81 → True
81 = 3⁴.
n=0 → False
No power of three equals zero.
n=-9 → False
Powers of three are positive, so a negative number never qualifies.
n=81
True
Run checks the first 3 tests in your browser. Submit checks all 72 tests on the server, hidden ones included.