2021 JMPSC Invitationals Problems/Problem 15

Problem

Abhishek is choosing positive integer factors of $2021 \times 2^{2021}$ with replacement. After a minute passes, he chooses a random factor and writes it down. Abhishek repeats this process until the first time the product of all numbers written down is a perfect square. Find the expected number of minutes it takes for him to stop.

Solution

8