https://sachachua.com/blog/2026/10/emacs-lisp-parse-page-ranges-insert-issue-references/ mentions a way to expand string ranges into e.g. #47, #48, #49, #50, #51, #52, #53, #54 and comes up with a function for that.
But there is already a library that does this and more: https://github.com/abo-abo/tiny
For this exact example, you'd type
m47, 54|#%d and hit C-; (if you bound that to tiny-expand) and you'd get "#47, #48, #49, #50, #51, #52, #53, #54". The syntax is
m followed by your range, and optionally a format string after a |. So if you didn't need the # before each number it becomes even simpler: m47, 54. Or you can change the separator: m1;3 becomes "1;2;3". You can even put in lisp expressions in there and drop the parentheses, it's extremely powerful.
https://redd.it/1wywgif
@r_emacs