Prove that there exists a polynomial p(x) with coefficients belonging to the set {-1, 0, 1} such that p(3) = n, for some positive integer n.
I started off my proof by noticing that n = either 3k or 3k±1 and that $p(x) = a_0+a_1x+a_2x^2+\cdots+a_nx^n$. It follows that $p(3) = a_0+3a_1+3^2a_2+\cdots+3^na_n$. Thus $p(3) = a_0+3(a_1+3a_2+\cdots+3^{n-1}a_n)$. We know that $a_0= -1,0 \text{ or }1$. Thus there exists a polynomial p(x) such that p(3)=3k, or 3k±1 = n. q.e.d.
Any help would be greatly appreciated. This is also my first time asking a question on this website so I apologize for my sloppy MathJAX skills.
There are $3^{n+1}$ strings $(a_0,a_1,...,a_n)$ which consists of entries in $\{-1,0,1\}$ and each string corresponds to a unique integer in the interval $[-(\frac{3^{n+1}-1}{2}),\frac{3^{n+1}-1}{2}]$ through the map $(a_0,a_1,...,a_n) \rightarrow \sum _{j=0}^n 3^ja_j$.
Hence every integer in the interval $[-(\frac{3^{n+1}-1}{2}),\frac{3^{n+1}-1}{2}]$ is attainable; letting $n \rightarrow \infty$ we have the result.