you simply do
seq 1 n | xargs -n 5 echo
n being the number you want to reach
If your OS has bash but not seq, here is an alternative (thx to @cuonglm and @jimmyj for their remarks)
echo {1..n} | xargs -n5
(you may have to be careful when reaching very high number with that one, depending on the OS and bash version, and if bash actually tried to expand first or in that case is clever enough to feed little by little without trying to fit the whole 1..n as a string in memory and feed that to echo...)
And thanks to cuonglm and StephaneChazelas, I add an alternative that is very, very less CPU heavy than my first xargs solution (in which xargs calls /bin/echo, instead of being able to use the shell's builtin, every 5 numbers) (it's probably similar to the 2nd one where xargs doesn't invoke echo) :
printf '%s %s %s %s %s\n' {1..n}
That 2nd and 3rd solution differs from the 1st in that the shell have first to expand 1..n, before printf (or xargs) can start printing, if I'm not mistaken... so it starts later (especially if n is big)... And could reach some limits (line length, or memory, depending on the implementation and the OS) if n is very big.