I've updated my dice problem collection with a new problem (#29 of the now 83 problems).
The question is: how many times, on average, do we need to roll a die, multiplying the results, until we reach a perfect square? So we might roll a 1 or 4 and be immediately square. Or we might roll 2-6-5-4-3-5 to reach the square 3600.
It turns out that the expected number of rolls needed is 2^pi(s) where s is the number of sides of the die, and pi(x) is the number of primes less than or equal to x.
So, curiously, a five-sided and a six-sided die both have 8 as the expected number of rolls.
Also, it doesn't matter whether the die is fair. As long as, for example, all sides are possible (have positive probability), the expected number of rolls is the same as a fair die.
Fun stuff!
https://www.madandmoonly.com/doctormatt/mathematics/dice1.pdf
