Problem 484: (2019 AIME II, 4)
A standard six-sided fair die is rolled four times. The probability that the product of all four numbers rolled is a perfect square is $\tfrac{m}{n}$, where $m$ and $n$ are relatively prime positive integers. Find $m+n$.
- Record each face by the parities of its exponents of $2,3,5$. The number of $5$'s must be even. Among the other faces, $1,4$ are trivial, and $2$, $3$, $6$ give the vectors $a$, $b$, $a+b$.
- Sequences of length $n$ from $\{1,2,3,4,6\}$ with total $0$: by symmetry (each nontrivial character sums to $1$), $\frac{5^n+3}4$. So $n=4$ gives $157$; $n=2$ (with two $5$'s in $\binom42$ positions): $6\cdot7=42$; four $5$'s: $1$.
- $\frac{200}{1296}=\frac{25}{162}$, so $m+n=187$. The answer is $\boxed{187}$.
A standard six-sided fair die is rolled four times. The probability that the product of all four numbers rolled is a perfect cube is $\tfrac{m}{n}$, where $m$ and $n$ are relatively prime positive integers. Find $m+n$.