Your over thinking the problem.
Id do it this way.
1.Select the random number for the output ($OutNumb)
2.Select a random number of times to update the slot display ($SlotNumb)
3.Generate a random number to show in the box ($ShowNumb)
4.Show $ShowNumb in box
5. Loop back to #3 $SlotNumb of times
6.Show the final number $OutNumb in the box
7. Do for each box in slot display
Writen in psudo code because 1 you didnt specify a language, 2 Im to lazy to write the script for you, and 3 You should do it anyway.