Skip to main content
1 of 2
Dominic van Essen
  • 36.4k
  • 2
  • 22
  • 60

R, 25 bytes

c(sample(99,rexp(1),T),0)

Try it online!

p(0) at each iteration is (e-1)/e.
p(each other number) at each iteration is (1/e)*(1/99).

Obviously this choice of random distribution gives a rather unsatisfying-looking output (since most of the runs are rather short). So this link uses the same approach, but changes p(0) to roughly 0.01 to illustrate some longer runs...

Dominic van Essen
  • 36.4k
  • 2
  • 22
  • 60