2

It's easy to count the number of monic polynomials of degree $n$ over $F_q$ without repeated roots using the following code (e.g., q = 3, n = 4):

sage: q = 3 
....: n = 4 
....: R.<x> = PolynomialRing(GF(q)) 
....: cnt = 0 
....: for i in R.polynomials(of_degree = n): 
....:     if i.is_monic() and gcd(i, i.derivative()) == 1: 
....:         cnt += 1 
....:  
....: print(cnt) 
....:  
....:                                                                                                                            
54

However, I'd like to know how to use a formula to count this number. I'd really appreciate it if anyone could help.

0xzm199
  • 23
  • 1
    One could build a gigantic sum of products of binomial coefficients starting with the number of irreducibles given (eg) in this question https://math.stackexchange.com/questions/152880/how-many-irreducible-polynomials-of-degree-n-exist-over-mathbbf-p – ancient mathematician Apr 25 '25 at 16:15

1 Answers1

2

The number of separable monic polynomials of degree $d$ over $\mathbb{F}_q$ is

$$\begin{cases} q & d=1 \\ q^d - q^{d-1} & d \neq 1 \end{cases}$$

This agrees with your code for what small primes I checked, and you can find a discussion in Jason Polak's paper Counting Separable Polynomials in $\mathbb{Z}/n[x]$. According to that paper, the origin of this result seems to be a 1932 result of Carlitz, available in The Arithmetic of Polynomials in a Galois Field. See in particular section I.6 "Formula for $Q_p(v)$" on pg 44 of Carlitz's article.


I hope this helps ^_^