For more elaborate sequences of numbers in Emacs macros, take a look at the tiny emacs package: https://github.com/abo-abo/tiny