05AB1E, 15 13 12 10 bytes
₄4°ŸεW°ö9Q
-2 bytes thanks to @Emigna
-3 bytes thanks to @Grimy
Explanation:
₄4°Ÿ # Create a list in the range [1000,10000]
ʒ # Filter this list by:
W # Get the smallest digit in the number (without popping the number itself)
° # Take 10 to the power this digit
ö # Convert the number from this base to an integer (in base-10)
9Q # Check if it's equal to 9
- If the smallest digit is \$d=0\$ it will become \$1\$ with the \$10^d\$ (
°
). And the number in base-1 converted to an integer in base-10 (ö
) would act like a sum of digits. - If the smallest digit is \$d=1\$ it will become \$10\$ with the \$10^d\$ (
°
). And the number in base-10 converted to an integer in base-10 (ö
) will of course remain the same. - If the smallest digit is \$d=2\$ it will become \$100\$ with the \$10^d\$ (
°
). And the number in base-100 convert to an integer in base-10 (ö
) would act like a join with0
in this case (i.e.2345
becomes2030405
). - If the smallest digit is \$d=3\$ it will become \$1000\$ with the \$10^d\$ (
°
). And the number in base-100 convert to an integer in base-10 (ö
) would act like a join with00
in this case (i.e.3456
becomes3004005006
). - ... etc. Smallest digits \$d=[4,9]\$ would act the same as \$d=2\$ and \$d=3\$ above, with \$d-1\$ amount of
0
s in the 'join'.
If the smallest digit is \$>0\$ with the given range \$[1000,10000]\$, the resulting number after °ö
would then be within the range \$[1111,9000000009000000009000000009]\$, so can never be equal to \$9\$. If the result is equal to \$9\$ (9Q
) it would mean the smallest digit is \$d=0\$, resulting in a base-1 with °ö
; and the sum of the digits was \$9\$.