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
Starting with Vim 8.0 one can use g Ctrl-a, see :help v_g_CTRL-A
Go to line #4, use Ctrl-v to blockwise select the first character, go down 4 lines, press Shift i, enter 0 (this is 0, followed by Space) and Esc to exit insert mode.
Now use gv to re-select the previously selected area. Press g Ctrl-a to create a sequence.
I start with a 0 here, so I can re-select by gv. If you start with a 1, you need to re-select by hand while omitting the first 1.
Use 2g Ctrl-a to use a step count of 2.