In my opinion the best way to think about PIE is through indicator functions (sometimes called characteristic functions). In fact, once you've set up the very simple idea of indicator functions PIE is an immediate consequence, and there are lots of other useful consequences too.
So what's the idea of characteristic functions? Well suppose the set S contains all possible integer strings of length n output by the random generator. Then we define the function

which intuitively represents "string
does not contains an even number", and takes as input a possible integer string from the random number generator, and outputs the value 1 if "string
does not contains an even number", and 0 otherwise. Notice that
)
counts the number of outcomes which don't contain an even number.
Similarly we can define

which represents "string does not contain a 5". In particular I chose to define

and

this way because the number of outcomes which satisfies the property associated with each of these indicator function is easily counted.
The intriguing thing about these indicator functions is that they convert logical operations into standard algebra. For example, what if we wanted to find the characteristic function which represents "string contains an even number", well this is just NOT(H_2), which has the indicator function

. I'll leave you to verify the following,
)
where

means that x translates into characteristic function y. The funny symbol represents "not".

represents "and"

represents "or"
Now we want to find the number of strings with products a multiple of 10. How do we represent this in terms of

and

? Well we want neither

nor

to occur, i.e. we want strings that contain an even number and a multiple of 5. Representing this in logical terms this is exactly
 \wedge (\neg H_5))
which using the above rules we can see has indicator function
(1-H_5))
. So to find the number of outcomes that have products that are multiples of 10 we simply sum over this indicator function, which is easily evaluated because we can expand out to get everything in terms of

and

which as I've previously mentioned have been chosen in particular because they're easily summed over!
)(1-H_5(s)) = \sum_{s \in S} (1 - H_2(s) - H_5(s) + H_2(s)H_5(s)))
 - \sum_{s \in S} H_5(s) + \sum_{s \in S} H_2(s)H_5(s))

Of course we simply divide by

to get the desired probability. It might seem that this is overkill, but that's because I was showing the gory details, on paper I'd maybe write one or two lines, or just the last line. Also, the case I've presented this for is simple and you can just think it through and work it out like /0 did, but it's rather helpful for more complicated scenarios which it easily adapts to.
Notice that in this language PIE can be stated as follows: suppose

are indicator functions each associated with a property, and you want to count the number of outcomes not satisfying any of these properties, then,
 \wedge (\neg A_2) \wedge \cdots \wedge (\neg A_n) \rightarrow (1 - A_1)(1 - A_2)\cdots (1 - A_n) = 1 - (A_1 + A_2 + \cdots A_n) + (A_1 A_2 + \cdots) + \cdots + (-1)^n A_1\cdot A_2 \cdots A_n)
So it's essentially been reduced to algebra.
