There are many different ways of doing things in LaTex.
I have never used the $ like rosala just showed you. Thanks Rosala.
I also do not understand why yours jumped to different lines but Rosala's stayed on the same line.
If I want a break I usually use \; or \: or \quad or \qquad
\; and \: give little breaks, \quad gives a slightly bigger break (maybe 4 units) and \qquad gives a bigger gap again (maybe 8 units)
1 \: 2 \; 3 \quad 4 \qquad5 See how the gaps get bigger :)
$$1\:2\;3\quad 4\qquad5$$
spaces in Latex, using the space bar, are usually meaningless :)
An important thing to know is that the symbol for a new line is \\
If you want to skip a line you would uses \\\\