Skip to main content
4 of 7
deleted 94 characters in body

Bash, 65 58 56 bytes

f()(echo ${a=$1};while((a));do echo $[a=RANDOM%a];done)

Try it online!

(Improved thanks to manatwork)