I just don't get it had it on a test can you help me? It was a test for math olympiads this is how the question looked exactly:
MATH
x 4
----------
HTAM ?
My guess is that you're working in base $10$. In this case we have $$\begin{matrix} & M & A & T & H \\ \times & & & & 4 \\ \hline & H & T & A & M \\ \hline ^{m} & ^{a} & ^{t} & ^{h} \end{matrix}$$ where the small letters $m,a,t,h$ refer to carried numbers.
Converting this to equations: $$\begin{alignat}{2} 4H &\,= 10h+M & \quad & \leftarrow \text{units}\\ 4T + h &\,= 10t + A && \leftarrow \text{tens}\\ 4A + t &\,= 10a + T && \leftarrow \text{hundreds}\\ 4M + a &\,= H && \leftarrow \text{thousands}\end{alignat}$$ This comes from simply carrying remainders.
We know $0 \le H \le 9$ because $H$ is a single digit, so by the fourth equation, $M = 0$, $1$ or $2$ (otherwise $4M+a$ is too big).
We can't have $M=1$ because the first equation tells us that $M$ is even, and presumably we can't have $M=0$ since then it wouldn't be a four-digit number, so $\boxed{M=2}$.
Now $a=0$ or $1$. Lets look what happens if $a=0$. (If this fails then we'll go back and try $a=1$.) Then the fourth equation gives $\boxed{H = 8}$.
Plugging this into the first equation gives $32 = 10h+2$ and hence $h=3$.
The second equation then gives $4T+3=10t+A$.
Since $a=0$, the third equation gives $4A+t=T$ (i.e. $t=T-4A$), so substituting $t=T-4A$ into the second equation yields $3=6T-39A$, i.e. $2T-13A=1$. This has the solution $\boxed{A=1}$ and $\boxed{T=7}$. (I solved this just by guessing.)
And sure enough $$\begin{matrix} 2 & 1 & 7 & 8 \\ \times & & & 4 \\ \hline 8 & 7 & 1 & 2 \end{matrix}$$