Question 118Call a positive integer "mild" if its base-3 representation never contains the digit $2$. How many values of $n$ ($1 \leq n \leq 1000$) have the property that $n$ and $n^{2}$ are both mild?