I tried searching for this on stack exchange but couldn't get it. I want to compute the number of irreducible polynomials of degree $n$ over the finite field $\mathbb{F}_q$
I know one method which uses mobius inversion formula, but I have seen my professor doing something using inclusion-exclusion for particular values of $n$ and $d$. I don't know what he did, but if anyone has any idea about it please let me know or if it is written somewhere then please provide me the reference for the same.
What I remember is he assumed some root, then said it has q^n possibilites and constructed some field, then went on to use inclusion exclusion principle and concluded but I couldn't understand what he said.