Is there a way to generate a number sequence in vi or Vim?
For example, for an arbitrary range of lines i through j (where i < j
:4,8s/^/\=line(".")-3." "
will do what you want
if you need count=2:
:4,8s/^/\=2*(line(".")-3)." "
this will give you 2,4,6,8,10
line numbers are hard coded in my example, you could use V to select those lines you want to change.