Skip to main content
1 of 4
Ethan
  • 455
  • 2
  • 9

PHP, 39 bytes

<?while($a=rand(0,$a??$argn))echo$a?>
\n
\n

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!


This uses PHP's null coalescing operator (??) to set $a's initial value to $argn.

The two \ns 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.

Example output:

141265555
\n
Ethan
  • 455
  • 2
  • 9