This is a pretty interesting topic

Like most statistical problems this one isn't difficult either, just tediously long to calculate. That's why Gakato's approach is clever, it's much easier to simulate it and collect the data.
First, I have a question. Shouldn't rule 6 say 'subtract from n'? Otherwise we can get a -1 index, and the list goes 0-37.
Btw I started constructing an equation for this problem, but without some programming it will be useless. I can already see that the final form will be monstrously long, containing plenty of sums to expand and around 3600 unique factors.
You couldn't even showcase such a big equation, let alone work with it. That's for 8 shop dungeons, with each extra shop added the number would increase exponentially.
I will try to make a table collecting the exact probabilities, but can't promise a condensed equation.