<s>[INST] $n^2$ for bases to prove that the last digit of base b ends with 0 Consider numbers written in base $b$, where $x\leq q\leq z$. For which bases $q$ $n^2$ ends with if $n$ ends with $0$.
 [/INST] Hint: For any base $b$, things will go bad if there is a positive integers $x$ such that $x^2$ is divisible by $b$ but $x$ isn't. For example, $30^2$ is divisible by $50$ but $30$ isn't, so things will go bad for base $50$. 
Added: Let us think about the specific bases $5$ to $9$. Let's see what we need to make sure that if $n^2$ ends in $0$, then $n$ ends in $0$.  To say that $n^2$ ends in $0$ is just to say that the base $b$ divides $n^2$. To say that $n$ ends in $0$ just says $b$ divides $n$.  
So we ask for the various bases, when does $b$ divides $n^2$ force $b$ divides $n$?
Case $b=5$: If $5$ divides $n^2$, does $5$ divide $n$? Sure. After all, $5$ is prime.
Case $b=6$: If $6$ divides $n^2$, does $6$ divide $n$? If $6$ divides $n^2$, then $2$ divides $n^2$ and $3$ divides $n^2$. But then $2$ divides $n$ and $3$ divides $n$, so $6$ divides $n$.
Case $b=7$: same reasoning as for $5$: if $7$ divides $n^2$ then $7$ divides $n$.
Case $b=8$: This one is different. Let $n=4$. Then $8$ divides $n^2$ but $8$ does not divide $n$.
Case $b=9$: This is like $b=8$. Let $n=6$. Then $9$ divides $n^2$ but $9$ does not divide $n$. 
Generalization: The "bad" bases $8$ and $9$ are each divisible by a perfect square greater than $1$. Call a positive integer $b$ square-free if no perfect square $\gt 1$ divides $b$. If $b$ is square-free, like $b=10$, then if $n^2$ in base $b$ ends in a $0$, then so does $n$.
If $b\gt 1$ is not square-free, there will be some $n$ such that in base $b$, the number $n^2$ ends in a $0$, but $n$ does not.  
</s>