6. How many positive integers are a power of 4 and can be written in base 3 using only the digits 0 and 1, with 0 as many times as desired (even none) and 1 at most twice?
(A) 4
(B) 2
(C) 1
(D) 0
(E) Infinite.
6. The answer is (B). A number that ends with zero in base 3 is a multiple of 3; since no power of 4 is a multiple of 3, the numbers we are looking for, in base 3, end with 1. If we use exactly one digit 1, the only possibility is the number that is written as "1" in base 3, which is 1. Allowing another digit 1, which corresponds to a certain $3^{k}$, means solving the equation $3^{k}+1=4^{a}$. Writing $4^{a}=2^{2a}$, we get $3^{k}=\left(2^{a}+1\right)\left(2^{a}-1\right)$, so both $2^{a}+1$ and $2^{a}-1$ are powers of 3, and it is clear that the only two powers of 3 that are 2 units apart are 1 and 3, from which $a=1$, and the only other power of 4 with the desired property is indeed 4.