Counting points in $\mathbb{F}_{p^n}$ Is there a closed formula for the number of elements of $\mathbb{F}_{p^n}$ which are not in any proper subfield of $\mathbb{F}_{p^n}$?
 A: The usual inclusion-exclusion business gives a formula involving the Möbius function:
$$
N(n)=\sum_{d\mid n}\mu\left(\frac n d\right)p^d.
$$
I'm not sure there is a cleaner formula, so if you don't count this as a "closed formula" you may be out of luck.

A related problem. The irreducible polynomials of degree $n$ in $\mathbb{F}_p[x]$ are exactly the minimal polynomials of the elements in the set you are asking about. Each such polynomial has $n$ roots of this kind. I added this link, because it leads to other links giving more background.
A: The subfields of $\mathbb{F}_{p^n}$ are all finite fields of characteristic $p$, and hence equal to $\mathbb{F}_{p^k}$ for some $k \leq n$. As $\mathbb{F}_{p^k}$ is the splitting field of $x(x^{p^k-1} - 1) = 0$ the set $\mathbb{F}_{p^k}$ contains $1$ and the $(p^k-1)$th roots of unity. A $(p^k-1)$th root of unity is an $(p^n-1)$th root of unity iff $(p^k-1) | (p^n-1)$, and so $\mathbb{F}_{p^k} \subset \mathbb{F}_{p^n}$ iff $(p^k-1) | (p^n-1)$.
In other words, an element of $\mathbb{F}_{p^n}$ is not contained in a proper subfield iff it is not a $(p^k-1)$th root of unity for any $k<1$. I believe there's a way to count these elements using the divisor/euler totient function, but I can't remember it off the top of my head.
