PHP, 4343 42 bytes
<?while($a=$a?rand(0,$a-1):$argn)echo$a?>
\n
\n>0
To run it:
echo '<input>' | php -nF <filename>
The two \n
s are supposed to represent blank lines because I couldn't get them to show up any other way. They add one blank line after the output, since 0
isn't printed.Try it online!
Example output:
1001912841
\n10019128410
-1 byte thanks to Titus's suggestion.