This is a reverse coding challenge.
Your task is to create a function that, when fed the inputs below, produce the sample outputs shown.
3 ➞ 21 9 ➞ 2221 17 ➞ 22221 24 ➞ 22228
If you get stuck, check the Comments for help.