Take a look into hashcat folder: rules/hybrid and check out append_d.rule file. You can easily extend these rules, just read on: https://hashcat.net/wiki/doku.php?id=rule_based_attack.
Another way to achieve your goal would be to use mask attack with --increment mode and mask like that: ?d?d?d?d?d
EDIT: and if you worry too much about rejected passwords, make use of hashcat-utils, especially splitlen programĀ https://hashcat.net/wiki/doku.php?id=has...s#splitlen and prepare correct rules / masksĀ for each password lengths.
Another way to achieve your goal would be to use mask attack with --increment mode and mask like that: ?d?d?d?d?d
EDIT: and if you worry too much about rejected passwords, make use of hashcat-utils, especially splitlen programĀ https://hashcat.net/wiki/doku.php?id=has...s#splitlen and prepare correct rules / masksĀ for each password lengths.