I answered my own question! Turns out I was thinking about that way to abstractly. Flipping a bunch of coins, then flipping a number equal to the number of coins that landed on heads is the exact same thing as flipping a bunch of coins twice and counting all the coins that came up heads twice. So it boils down to one Bernoulli trial, with probability p_0 * p_1. A bunch of these makes the binomial distribution B(n_0, p_1 * p_2). And this can be expanded to more recursions.