Numbers ending with 0 $2n$ ends with $0$ if $n$ ends with $0$. So how can we know if 2n ended with 0 in the first place?

Let $n=a_0+a_1b+a_2b^2+\cdots+a_{r-1}b^{r-1}+a_rb^r$ in base $b$
So, $$n^2=(a_0+a_1b+a_2b^2+\cdots+a_{r-1}b^{r-1}+a_rb^r)^2$$
$$=a_0^2+2a_0a_1b+b^2(a_2^2+2a_0a_1)+2b^3(a_0a_3+a_1a_2)+\cdots+a_r^2b^{2r}$$
Now, $n^2$ and $n$ with end with same digit if $b$ divides $a_0^2-a_0=a_0(a_0-1)$
If $a_0=0, b$ always divides $a_0(a_0-1)$, hence $n^2$ will end with $0$ if $n$ ends with $0$
A little generalization : 
Observe that $(a_0,a_0-1)=1$
If $b$ is prime like $5,7$ or power of prime like $2^3=8, 3^2=9$, so 
either $b\mid a_0\implies a_0=0$ as $0\le a_0<b$
or $b\mid(a_0-1) \implies a_0=1$
If $b$ can be expressed as a product of two other numbers $p,q$ such that $p>q>1;(p,q)=1$ like $6$
either $(i)p\mid a_0, q\mid(a_0-1)$
or $(ii) q\mid a_0, p\mid(a_0-1)$
or $(iii) q\mid a_0(a_0-1)$
or $(ii) p\mid a_0(a_0-1)$
$(i),(ii)$ can be solved using CRT.
