2916023

https://math.stackexchange.com/questions/2916023/i-dont-see-how-the-binomial-theorem-relates-to-the-principle-of-inclusion-and-e

Determine the number of positive integers LE than 100 not divisible by 2,3 or 5.

In Goulden-Jackson approach, the PIE looks like :

$$N(x)=E(x+1)$$

For the considered example we will obtain the "exact generating function"

$$E(x) = 26 + 48x + 32x^2 + 3x^3$$

since we have 26 numbers that are not divisible with 2 or 3 or 5, 48 numbers that are divisible with exactly one of {2,3, 5}, 32 numbers divisible with exactly two of them and three numbers divisible with 2 and 3 and 5.

$$N(x) = 100 + 103x + 32x^2 + 3x^3$$

is the "at least" generating function for numbers that are divisible with at least zero, one, two or three of {2,3,5}

We have to obtain the 26 knowing 100, 103 = 50 + 33 + 20, 32 = 16 + 6 + 10 and 3

Well, by Goulden-Jackson, $$26 = E(0) = N(-1) = 100-103+32-3$$

One may see that the binomial coefficients occur in $$E(x+1)$$.

Species Formula
$$N(X,Y,Z) = 100 + 50[X] + 33[Y] + 20[Z] + 16[X,Y] + 10 [Y,Z] + 6[Y,Z] + 3[X,Y,Z]$$