I know the problem of the number monic, irreducible polynomials of degree $k$ in $\mathbb{F}_p$ have been discussed and that there is a general formula which solves this problem. Nevertheless, I have trouble to understand another approach.
My solution is counting the number of irreducible monic polynomials of degree $6$ in $\mathbb{Z}_2$.
Therefore, we regard $x^{2^6}-x \in \mathbb{Z}_2[x]$ and we know that it can factorized into all irreducible polynomials of degree $1,2,3,6$ over $\mathbb{Z}_2[x]$.
We use the formula $\frac{p^k-p}{p}$ to determine the number of irreducible polynomials of a degree $k$ in $\mathbb{F}_p$ where $k \in \mathbb{P}$ for the divisors of $6$:
$$\frac{2^2-2}{2} = 1$$
$$\frac{2^3-2}{2} = 2$$
And we observe that there are $2$ polynomials of degree $1$.
Up until know I understand the solution but then the results are connected into a formula without further explanation:
$$\frac{2^6-2\cdot1-1\cdot2-2\cdot3}{6} = 9$$
This is the correct result but I do not understand the last step. This looks like an elegant way to solve this problem for small numbers in an exam without usage of the general formula.