1 Background

A positive integer n is called a square-full number if \(p^{2}|n\) for every prime factor p of n. Denote by \(\alpha _{2}\) the indicator function of square-full numbers, i.e.

$$\begin{aligned} \alpha _{2}(n) = {\left\{ \begin{array}{ll} 1 &{} \hbox {if }n \hbox { is square-full},\\ 0 &{} \hbox {otherwise}. \end{array}\right. } \end{aligned}$$
(1.1)

Let \(\mathcal {A}(x)\) be the number of square full integers not exceeding x. In 1935, Erdös and Szekeres [5] proved

$$\begin{aligned} \mathcal {A}(x)=\frac{\zeta (3/2)}{\zeta (3)}x^{1/2}+O_{\epsilon }(x^{1/3+\epsilon }). \end{aligned}$$
(1.2)

Bateman and Grosswald [1] improved this result in 1958. They obtained

$$\begin{aligned} \mathcal {A}(x)=\frac{\zeta (3/2)}{\zeta (3)}x^{1/2}+\frac{\zeta (2/3)}{\zeta (2)}x^{1/3}+O(x^{1/6}\cdot \mathrm {e^{-c(\log ^{3}x/\log \log x)^{\frac{1}{5}}}}), \end{aligned}$$
(1.3)

where c is a positive absolute constant. They also made the observation that any improvement of the exponent \(\frac{1}{6}\) would imply that \(\zeta (s)\ne 0\) for \(\mathfrak {R}s>1-\delta ~~~(\delta >0).\) There is a very long history of studies and conditional improvements (assuming RH) of the error term in the above formula (see [2,3,4, 15, 19,20,21,22]).

It follows from (1.3) that for intervals of length \(H>x^{2/3 +\epsilon }\) we have

$$\begin{aligned} \sum _{x\le n \le x+H}\alpha _{2}(n)\sim \frac{\zeta (3/2)}{2\zeta (3)}\cdot H/x^{1/2}. \end{aligned}$$
(1.4)

Various authors used exponential sum techniques to reduce the lower bound on H for which this asymptotic is valid. Heath-Brown [7] proved it with for \(H>x^{\eta +\epsilon }\) with \(\eta =0.6318\ldots \) Liu [16] proved it with \(\eta =0.6308\ldots \) Filaseta and Trifonov [6] found a simpler approach, using real instead of complex analysis, and obtained the exponent \(\eta =0.6282\ldots \) In [8], Huxley and Trifonov improve this to \(H\ge \frac{1}{\epsilon }x^{5/8}(\log x)^{5/16}\).

Concerning the distribution of square full numbers in arithmetic progressions, the most recent result is due to Munsch [17]. By evaluating character sums, he showed that

$$\begin{aligned} \sum _{\begin{array}{c} n\le x\\ n=a \mod q \end{array}}\alpha _{2}(n)\sim \frac{\zeta (3/2)}{\zeta (3)}\frac{A_{a,q}}{q}x^{1/2}+ \frac{\zeta (2/3)}{\zeta (2)}\frac{B_{a,q}}{q}x^{1/3}, \end{aligned}$$
(1.5)

where

$$\begin{aligned} A_{a,q}=\prod _{p|q}\left( 1-\frac{1}{p^{3}}\right) ^{-1}\sum _{\chi \in X_{2}}\chi (a) \frac{L(3/2,\chi )}{\zeta (3/2)} \end{aligned}$$

and

$$\begin{aligned} B_{a,q}=\prod _{p|q}\left( 1-\frac{1}{p^{2}}\right) ^{-1}\sum _{\chi \in X_{3}}\bar{\chi }(a) \frac{L(2/3,\chi )}{\zeta (2/3)} \end{aligned}$$

with \(X_{2}\) and \(X_{3}\) being the set of all quadratic and cubic characters mod q respectively and \(L(s,\chi )\) is the L-function attached \(\chi \).

The goal of this paper is to study the fluctuations of the analogous sums in the function field settings. Namely, we study the variance of the sum of \(\alpha _{2}\) in arithmetic progressions and in short intervals, in the context of the ring \(\mathbb {F}_q[T]\) of polynomials over a finite field \(\mathbb {F}_q\) of q elements, in the limit \(q\rightarrow \infty \). In our setting we succeed in giving definitive results in both cases.

Our approach involves converting the problem to one about the correlation of zeros of a certain family of L-functions, and then using an equidistribution result of Katz which holds in the limit \(q \rightarrow \infty \).

2 Square-full polynomials

Let \(\mathbb {F}_q\) be a finite field of an odd cardinality q, and let \(\mathcal M_n\) be the set of all monic polynomials of degree n with coefficients in \(\mathbb {F}_q\). In analogy to numbers, we say that \(f\in \mathcal M_n\) is a square-full polynomial if for every polynomial \(P\in \mathcal M_n\) that divides f, \(P^{2}\) also divides f. We denote by \(\alpha _{2}\) the indicator function of square-full polynomials, i.e.

$$\begin{aligned} \alpha _{2}(f) = {\left\{ \begin{array}{ll} 1 &{} \text{ if } f \text{ is } \text{ square-full, }\\ 0 &{} \text{ otherwise. } \end{array}\right. } \end{aligned}$$
(2.1)

The mean value of \(\alpha _{2}\) over all monic polynomials is defined to be

$$\begin{aligned} \langle \alpha _{2}\rangle _{n}:=\frac{1}{q^{n}}\sum _{f\in \mathcal M_n}\alpha _{2}(f). \end{aligned}$$
(2.2)

The generating function for the number of monic square-full polynomials of degree n, i.e. \(\sum _{f\in M_{n}}\alpha _{2}(f) \) is (see [1])

$$\begin{aligned} \sum _{n=0}^{\infty }\sum _{f\in M_{n}}\alpha _{2}(f) u^{n}=\frac{Z(u^{2})Z(u^{3})}{Z(u^{6})}, \end{aligned}$$
(2.3)

where Z(u) is the zeta function of \(\mathbb {F}_q[T]\) (also set \(\zeta _{q}:=Z(q^{-s})\)) , given by the following product over prime polynomials in \(\mathbb {F}_q[T]\)

$$\begin{aligned} Z(u)=\prod _{P }(1-u^{\deg P})^{-1}=\frac{1}{1-qu}. \end{aligned}$$
(2.4)

By expanding we have

$$\begin{aligned} \frac{Z(u^{2})Z(u^{3})}{Z(u^{6})}=\sum _{i,j=0}^{\infty }u^{2i+3j}q^{i+j}(1-qu^{6}). \end{aligned}$$
(2.5)

Therefore, for \(n\ge 6\) the coefficient of \(u^{n}\) is given by

$$\begin{aligned}&\sum _{2i+3j=n}q^{i+j}-q\sum _{2i+3j=n-6}q^{i+j}\nonumber \\&\quad = q^{n/2}\sum _{\begin{array}{c} j=n\mod 2\\ 0\le j \le \left\lfloor \frac{n}{3}\right\rfloor \end{array}}q^{\frac{-j}{2}}-q\cdot q^{n/2}\sum _{\begin{array}{c} j=n\mod 2\\ 0\le j \le \left\lfloor \frac{n}{3}\right\rfloor -2 \end{array}}q^{\frac{-j}{2}-3}, \end{aligned}$$
(2.6)

which give for \(n\ge 6\)

$$\begin{aligned} \sum _{f\in M_{n}}\alpha _{2}(f)=\frac{q^{n/2}}{\zeta _{q}(3)}\sum _{\begin{array}{c} j=n\mod 2\\ 0\le j \le \left\lfloor \frac{n}{3}\right\rfloor -2 \end{array}}q^{\frac{-j}{2}} +q^{\lfloor {\frac{n-\lfloor n/3\rfloor }{2}\rfloor }}. \end{aligned}$$
(2.7)

Therefore in the limit of \(q\rightarrow \infty \) we get

$$\begin{aligned} \langle \alpha _{2}\rangle _{n}\sim q^{\lfloor n/2 \rfloor -n}. \end{aligned}$$
(2.8)

2.1 Arithmetic progressions

Let \(Q\in \mathbb {F}_q[T]\) be a squarefree polynomial of a positive degree. The sum of \(\alpha _{2}\) over all monic polynomials of degree n lying in the arithmetic progressions \(f=A\mod Q\) is

$$\begin{aligned} {S}_{\alpha _{2};n;Q}(A):=\sum _{\begin{array}{c} f\in \mathcal M_n\\ f=A \mod Q \end{array}}\alpha _{2}(f). \end{aligned}$$
(2.9)

The average of this sum \({S}_{\alpha _{2};n;Q}(A)\) when we vary A over residue classes coprime to Q is

$$\begin{aligned} \langle {S}_{\alpha _{2};n;Q}\rangle =\frac{1}{\Phi (Q)}\sum _{\begin{array}{c} f\in \mathcal M_n\\ (f,Q)=1 \end{array}}\alpha _{2}(f), \end{aligned}$$
(2.10)

where \(\Phi (Q)\) is the number of invertible residues modulo Q.

In Sect. 4 we will consider the variance of \({S}_{\alpha _{2};n;Q}\) which is defined to be the average of the squared difference between \({S}_{\alpha _{2};n;Q}\) and its mean value

$$\begin{aligned} {\text {Var}}({S}_{\alpha _{2};n;Q})=\frac{1}{\Phi (Q)}\sum _{\begin{array}{c} A \mod Q\\ (A,Q)=1 \end{array}}|{S}_{\alpha _{2};n;Q}-\langle {S}_{\alpha _{2};n;Q}\rangle |^{2}. \end{aligned}$$
(2.11)

proving the following theorem:

Theorem 2.1

Let Q be a prime polynomial of degree bigger than 3, and set \(N:=\deg Q - 1\), then in the limit \(q\rightarrow \infty \) the following holds:

for \(N\le n\le 2N+1\)

$$\begin{aligned} {\text {Var}}({S}_{\alpha _{2};n;Q})\sim \frac{q^{\left\lfloor \frac{n}{2}\right\rfloor }}{\Phi (Q)}, \end{aligned}$$

for \(2N+1< n\) even

$$\begin{aligned} {\text {Var}}({S}_{\alpha _{2};n;Q})\sim \frac{q^{n}}{\Phi (Q)^{2}}, \end{aligned}$$

for \(2N+1< n\) odd

$$\begin{aligned} {\text {Var}}({S}_{\alpha _{2};n;Q})=O\left( \frac{q^{n-2}}{\Phi (Q)^{2}}\right) . \end{aligned}$$

Note that the restriction that Q is a prime is for simplicity only and we can also do the more general case of squarefree Q in the same way.

2.2 Short intervals

A “short interval” in \(\mathbb {F}_q[x]\) is a set of the form

$$\begin{aligned} I(A;h) = \{f:||f-A||\le q^h\}, \end{aligned}$$
(2.12)

where \(A\in \mathcal M_n\) and \(0\le h\le n-2\). The norm is

$$\begin{aligned} ||f||:=\#\mathbb {F}_q[t]/(f) = q^{\deg f}\;. \end{aligned}$$
(2.13)

The cardinality of such a short interval is

$$\begin{aligned} \#I(A;h)=q^{h+1}=:H \;. \end{aligned}$$
(2.14)

To facilitate comparison between statements for number field results and for function fields, we use a rough dictionary:

$$\begin{aligned} X&\leftrightarrow&q^{n} \nonumber \\ \log X&\leftrightarrow&n \nonumber \\ H&\leftrightarrow&q^{h+1} \nonumber \\ \log H&\leftrightarrow&H+1 \end{aligned}$$
(2.15)

We define for \(1\le h<n\) and \(A\in \mathcal M_n\)

$$\begin{aligned} \mathcal N_{\alpha _{2};h}(A):= \sum _{f\in I(A;h)}\alpha _{2}(f) \end{aligned}$$
(2.16)

to be the number of square-full polynomials in the interval I(Ah).

The mean value of \(\mathcal N_{\alpha _{2};h}\) when we average over \(A\in \mathcal M_n\) is

$$\begin{aligned} \langle \mathcal N_{\alpha _{2};h} \rangle := \frac{1}{q^{n}} \sum _{A\in \mathcal M_n} \mathcal N_{\alpha _{2};h}(A). \end{aligned}$$
(2.17)

In Sect. 5 we will compute the variance of \(\mathcal N_{\alpha _{2};h}\)

$$\begin{aligned} {\text {Var}}(\mathcal N_{\alpha _{2};h}):=\frac{1}{q^{n}}\sum _{A\in \mathcal M_n}|\mathcal N_{\alpha _{2};h}(A)-\langle \mathcal N_{\alpha _{2};h} \rangle |^{2} \end{aligned}$$
(2.18)

proving the following theorem:

Theorem 2.2

Set \(N:=n-h-2\), then in the limit \(q\rightarrow \infty \) the following holds: for \(0\le n\le 2N\)

$$\begin{aligned} {\text {Var}}(\mathcal N_{\alpha _{2};h})\sim \frac{H}{q^n}\cdot q^{\left\lfloor \frac{n}{2}\right\rfloor }, \end{aligned}$$
(2.19)

for \(2N< n\le 5N\)

$$\begin{aligned} {\text {Var}}(\mathcal N_{\alpha _{2};h})\sim \frac{H}{q^n}\cdot q^{\left\lfloor \frac{n+N}{3}\right\rfloor }, \end{aligned}$$
(2.20)

for \(5N< n\)

$$\begin{aligned} {\text {Var}}(\mathcal N_{\alpha _{2};h})\sim \frac{H}{q^n}\cdot q^{\frac{n+N}{6}}\cdot q^{\frac{-\lambda _{n}}{6}}, \end{aligned}$$
(2.21)

where

$$\begin{aligned} \lambda _{n}= {\left\{ \begin{array}{ll} 0 &{} n=5N \mod 6,\\ 7 &{} n=5N+1 \mod 6,\\ 6 &{} n=5N+2 \mod 6,\\ 3 &{} n=5N+3 \mod 6,\\ 4 &{} n=5N+4 \mod 6,\\ 11 &{} n=5N+5 \mod 6. \end{array}\right. } \end{aligned}$$
(2.22)

The conditions one needs to place on n in both Theorems 2.1 and 2.2 are not obvious to begin with. They will follow eventually because we express the variance in both cases in terms of zeros of L-functions, which are known to be polynomials in the function field settings.

3 Dirichlet characters and Katz’s equidistribution results

3.1 Dirichlet characters

Let \(Q(T)\in \mathbb {F}_q[T]\) be a polynomial of positive degree. A Dirichlet character modulo Q is a homomorphism

$$\begin{aligned} \chi : (\mathbb {F}_q[T]/(Q))^{\times }\rightarrow \mathbb {C}^{\times }. \end{aligned}$$
(3.1)

One can extend \(\chi \) to \(\mathbb {F}_q[T]\) by defining it to vanish on polynomials which are not coprime to Q. We denote by \(\Gamma (Q) \) the group of all Dirichlet characters modulo Q. Note that \(|\Gamma (Q)|\) is the Euler totient function \(\Phi (Q)\). A Dirichlet character needs then to satisfy the following: \(\chi (fg)=\chi (f)\chi (g)\) for all \(f,g \in \mathbb {F}_q[T]\), \(\chi (1)=1\) and \(\chi (f+hQ)=\chi (f)\) for all \(f,h \in \mathbb {F}_q[T].\)

The orthogonality relations for Dirichlet characters are:

$$\begin{aligned} \frac{1}{\Phi (Q)}\sum _{\chi \mod Q}\bar{\chi }(A)\chi (N)= {\left\{ \begin{array}{ll} 1 &{} N=A\mod Q, \\ 0 &{} \text{ otherwise }. \end{array}\right. } \end{aligned}$$
(3.2)
$$\begin{aligned} \frac{1}{\Phi (Q)}\sum _{A \mod Q}\bar{\chi _{1}}(A)\chi _{2}(A)= {\left\{ \begin{array}{ll} 1 &{} \chi _{1}=\chi _{2}, \\ 0 &{} \text{ otherwise }. \end{array}\right. } \end{aligned}$$
(3.3)

A character \(\chi \) is primitive if there is no proper divisor \(Q'|Q\) such that \(\chi (f)=1\) whenever f is co-prime to Q and \(f=1\mod Q'.\) A character \(\chi \) is called ”even” if it acts trivially on the elements of \(\mathbb {F}_q\), i.e. if \(\chi (cf)=\chi (f)\) for all \(0\ne c\in \mathbb {F}_q.\) Therefore, the number of even characters is given by \(\Phi ^{ev}(Q)=\frac{\Phi (Q)}{q-1}\). For example there are \(q^{m-1}\) even character mod \(T^{m}\). Out of this there are \(O(q^{m-2})\) nonprimitive even characters mod \(T^{m}\) (see subsection 3.3 in [13]) . A character is called ”odd” if it is not even.

Define the following:

\(\Gamma _{prim}(Q)\) :

the set of all primitive characters mod Q, \(\Phi _{prim}(Q):=|\Gamma _{prim}(Q)|.\)

\(\Gamma _{prim}^{ev}(Q)\) :

the set of primitive even characters mod Q, \(\Phi _{prim}^{ev}(Q):=|\Gamma _{prim}^{ev}(Q)|.\)

\(\Gamma _{prim}^{odd}(Q)\) :

the set of primitive odd characters mod Q, \(\Phi _{prim}^{odd}(Q):=|\Gamma _{prim}^{odd}(Q)|.\)

\(\Gamma _{d\text {-}prim}(Q)\) :

the set of all characters \(\chi \) mod Q such that \(\chi ^{d}\) (i.e. \(\chi \times \cdots \times \chi \)) is primitive for the fixed integer \(d>0\), \(\Phi _{d\text {-}prim}(Q):=|\Gamma _{d\text {-}prim}(Q)|.\) Note that this is a subset of \(\Gamma _{prim}(Q).\)

\(\Gamma _{d\text {-}prim}^{d\text {-}odd}(Q)\) :

the set of all characters \(\chi \) mod Q such that \(\chi ^{d}\) is primitive and odd for the fixed integer \(d>0\), \(\Phi _{d\text {-}prim}^{d\text {-}odd}(Q):=|\Gamma _{d\text {-}prim}^{d\text {-}odd}(Q)|.\)

Next, we will check the proportion of the set \(\Gamma _{d-prim}(Q)\) in the group of all characters mod Q ,\(\Gamma (Q).\)

Lemma 3.1

Let \(Q\in \mathbb {F}_q[t]\) be a square-free polynomial, then in the limit of a large field size \(q\rightarrow \infty \),

$$\begin{aligned} \frac{\Phi _{d\text {-}prim}(Q)}{\Phi (Q)}=1+O\left( \frac{1}{q}\right) . \end{aligned}$$
(3.4)

Proof

By subsection (3.3) in [13] we have

$$\begin{aligned} \# (\Gamma (Q) \slash \Gamma _{prim}(Q))\le c\cdot q^{n-1} \end{aligned}$$
(3.5)

for some constant c. Note that a character \(\chi \) does not lie in \(\Gamma _{d\text {-}prim}(Q)\) if \(\chi ^{d}\) does not lie in \(\Gamma _{prim}(Q)\). In that case, \(\chi ^{d}\) lies in \(\Gamma (Q)\slash \Gamma _{prim}(Q).\) Now consider the map \(\chi \mapsto \chi ^{d}\). Its kernel is of cardinality \(\#\lbrace \chi | \chi ^{d}=1 \rbrace \). Since every \(\chi \) is a product of characters \(\chi _{j}\) of \(\mathbb {F}_q[T]/(f_{j})\) when \(Q=\prod _{j=1}^{k}f_{j},\) \(\deg (f_{j})=d_{j}\) and \(\sum _{i=1}^{k}d_{i}=n\), the following bound holds:

$$\begin{aligned} \# \lbrace \chi | \chi ^{d}=1 \rbrace \le d^{n}. \end{aligned}$$
(3.6)

Since every character \(\chi \) such that \(\chi ^{d}\) is not primitive can be written as a product of a non primitive character and an element of the kernel, we get that \(\#(\Gamma (Q)\slash \Gamma _{d\text {-}prim}(Q))\) can be at most \(d^{n}\cdot c\cdot q^{n-1}\).

Now, if Q factors into k irreducible polynomials \(f_{i}\) of degree \(d_{i}\), \(\deg Q:=n=\sum _{i=1}^{k}d_{i}\) then \(\Phi (Q)=\prod _{i=1}^{k}(q^{d_{i}}-1)\ge (q-1)^{n}\). It follows that \(\Phi _{d-prim}(Q) \ge (q-1)^{n}-d^{n}\cdot c\cdot q^{n-1}\). Therefore, in the limit of \(q\rightarrow \infty \) we get (3.4). \(\square \)

Note that equation (3.25) in [13] asserts that as \(q\rightarrow \infty \), almost all characters are primitive and odd in the sense that

$$\begin{aligned} \frac{\Phi _{prim}^{odd}(Q)}{\Phi (Q)}=1+O\left( \frac{1}{q}\right) . \end{aligned}$$
(3.7)

Hence, exactly as before, we may also show that

Lemma 3.2

Let \(Q\in \mathbb {F}_q[t]\) be a square-free polynomial, then in the limit of a large field size \(q\rightarrow \infty \),

$$\begin{aligned} \frac{\Phi _{d\text {-}prim}^{d\text {-}odd}(Q)}{\Phi (Q)}=1+O\left( \frac{1}{q}\right) . \end{aligned}$$
(3.8)

Next, we will prove a short lemma stating that under certain restrictions on the characteristic of the field, the primitivity of \(\chi \) and \(\chi ^{d}\) is equivalent when \(\chi \) is an even character mod \(T^{m}\). This lemma will be useful later on in Sect. 5.

Lemma 3.3

Let d be an integer co-prime to \(\Phi (Q)\). Then the map \(\chi \mapsto \chi ^{d}\) is an automorphism of the group of characters mod Q, i.e. an automorphism of \(\Gamma (Q)\).

Proof

The map is clearly an homomorphism since the group is abelian. Now, d is co-prime to the order of the group therefore there aren’t any elements whose order dividing d and hence the kernel of the map is trivial. \(\square \)

Lemma 3.4

Let \(\chi \) be an even Dirichlet character mod \(T^{m}\), and let d be an integer s.t. \(d<p\) when p is the characteristic of the field \(\mathbb {F}_q\). Then \(\chi \) is a primitive character if and only if \(\chi ^{d}\) is a primitive character.

Proof

The order of the subgroup of even characters mod \(T^{m}\) is \(\Phi ^{ev}(T^{m})=q^{m-1}\). Taking \(d<p\) when p is the characteristic of the field \(\mathbb {F}_q\) gives d co-prime to \(\Phi (T^{m})\), in which case the above lemma applies. \(\square \)

3.2 Dirichlet L-functions

Here we review some standard background concerning Dirichlet L-functions for the rational function field; see, for example [18], subsection 3.4 in [13], or section 6 in [14].

The L-function associated to a Dirichlet character \(\chi \mod Q\) is defined as the following product over prime polynomials \(P\in \mathbb {F}_q[T]\)

$$\begin{aligned} L(u,\chi )=\prod _{P \not \mid Q}(1-\chi (P)u^{\deg P})^{-1}. \end{aligned}$$
(3.9)

The product is absolutely convergent for \(|u|<1/q\). For \(\chi =\chi _{0}\) the trivial character mod Q

$$\begin{aligned} L(u,\chi _{0})=Z(u)\prod _{P | Q}(1-u^{\deg P}). \end{aligned}$$
(3.10)

If \(Q\in \mathbb {F}_q[T]\) is a polynomial of degree \(\deg Q\ge 2\) and \(\chi \) is a nontrivial character mod Q, then the L-function associated to \(\chi \) i.e. \(L(u,\chi )\) is a polynomial in u of degree at most \(\deg Q -1\). If \(\chi \) is even then \(L(u,\chi )\) has a trivial zero at \(u=1\). Now, we may factor \(L(u,\chi )\) in terms of the inverse roots

$$\begin{aligned} L(u,\chi )=\prod _{j=1}^{\deg Q -1}(1-\alpha _{j}(\chi )u) \end{aligned}$$
(3.11)

for which the Riemann hypothesis, proved by Weil, asserts that for each (nonzero) inverse root, either \(|\alpha _{j}(\chi )|=1\) or

$$\begin{aligned} |\alpha _{j}(\chi )|=q^{1/2}. \end{aligned}$$
(3.12)

For a primitive odd character mod Q all the inverse roots have absolute value \(q^{1/2}\). For a primitive even character mod Q all the inverse roots have absolute value \(q^{1/2}\), except for the trivial zero at 1. Thus, we may write \(\alpha _{j}(\chi )=q^{1/2} {\text {e}}^{i\Theta _{j}}\), and the L-function (for a primitive character \(\chi \)) is

$$\begin{aligned} L(u,\chi )=(1-\lambda _{\chi }u)^{-1}\det (I-uq^{1/2}\Theta _{\chi }),\quad \quad \Theta _{\chi }={\text {diag}}( {\text {e}}^{i\Theta _{1}},\ldots , {\text {e}}^{i\Theta _{N}}). \end{aligned}$$
(3.13)

where \(N=\deg Q -1\) and \(\lambda _{\chi }=0\) for odd character \(\chi \). For even \(\chi \) we have \(N=\deg Q -2\) and \(\lambda _{\chi }=1\). The unitary matrix \(\Theta _{\chi }\in U(N)\) determines a unique conjugacy class which is called the unitarized Frobenius matrix of \(\chi \).

3.3 Katz’s equidistribution results

The main ingredients in our results on the variance are equidistribution and independence results for the Frobenii \(\Theta _{\chi }\) due to N. Katz.

Theorem 3.5

[9] Fix \(m \ge 4\). The unitarized Frobenii \(\Theta _{\chi }\) for the family of even primitive characters \(\mod T^{m+1}\) become equidistributed in the projective unitary group \(PU(m-1)\) of size \(m-1\), as q goes to infinity.

Theorem 3.6

[11] If \(m \ge 5\) and in addition the characteristics of the fields \(\mathbb {F}_q\) are bigger than 13, then the set of conjugacy classes \((\Theta _{\chi ^{2}}, \Theta _{\chi ^{3}}, \Theta _{\chi ^{6}} )\), \(\chi \) is even primitive character \(\mod T^{m+1}\), become equidistributed in the space of conjugacy classes of the product \(PU(m-1) \times PU(m-1)\times PU(m-1)\) as q goes to infinity.

For odd characters, the corresponding equidistribution and independence results are

Theorem 3.7

[10] Fix \(m \ge 2\). Suppose we are given a sequence of finite fields \(\mathbb {F}_q\) and squarefree polynomials \(Q(T) \in \mathbb {F}_q[T]\) of degree m. As \(q \rightarrow \infty \), the conjugacy classes \(\Theta _{\chi }\) with \(\chi \) running over all primitive odd characters modulo Q, are uniformly distributed in the unitary group \(U(m-1)\).

Theorem 3.8

[12] If in addition we restrict the characteristics of the fields \(\mathbb {F}_q\) is bigger than 6, then the set of conjugacy classes \((\Theta _{\chi ^{2}}, \Theta _{\chi ^{3}}, \Theta _{\chi ^{6}} )\) with \(\chi \) running over all characters such that \(\chi ^{2},\chi ^{3},\chi ^{6}\) are primitive odd characters modulo Q, become equidistributed in the space of conjugacy classes of the product \(U(m-1) \times U(m-1)\times U(m-1)\) as q goes to infinity.

4 The variance in arithmetic progressions

4.1 The mean value

Given a polynomial \(Q\in \mathbb {F}_q[T]\) the average of \({S}_{\alpha _{2};n;Q}(A)\) when we vary A over residue classes co-prime to Q (see (2.9)) equals to

$$\begin{aligned} \langle {S}_{\alpha _{2};n;Q}\rangle =\frac{1}{\Phi (Q)}\sum _{\begin{array}{c} f\in \mathcal M_n\\ (f,Q)=1 \end{array}}\alpha _{2}(f)=\frac{1}{\Phi (Q)}\sum _{f\in \mathcal M_n}\chi _{0}(f)\alpha _{2}(f) \end{aligned}$$
(4.1)

To evaluate this consider the generating function

$$\begin{aligned} \frac{1}{\Phi (Q)}\sum _{\begin{array}{c} f\in \mathcal M_n\\ (f,Q)=1 \end{array}}\alpha _{2}(f)u^{n}&=\frac{1}{\Phi (Q)}\cdot \sum _{f\in \mathcal M_n}\chi _{0}(f)\alpha _{2}(f)u^{n} \nonumber \\&=\frac{1}{\Phi (Q)}\cdot \frac{L(u^{2},\chi _{0})L(u^{3},\chi _{0})}{L(u^{6},\chi _{0})} \nonumber \\&=\frac{1}{\Phi (Q)}\cdot \frac{Z(u^{2})Z(u^{3})}{Z(u^{6})}\prod _{P|Q}\left( \frac{(1-u^{2\deg P})(1-u^{3\deg P})}{(1-u^{6\deg P})}\right) \nonumber \\&=\frac{1}{\Phi (Q)}\cdot \frac{Z(u^{2})Z(u^{3})}{Z(u^{6})}\prod _{P|Q}\left( \frac{(1-u^{2\deg P})}{(1+u^{3\deg P})}\right) . \end{aligned}$$
(4.2)

By expanding and comparing coefficients it is clear that the leading order coefficient in q (we are interested in \(q\rightarrow \infty \)) comes from \(\frac{Z(u^{2})Z(u^{3})}{Z(u^{6})}.\) Therefore, by 2.8, we have

$$\begin{aligned} \langle {S}_{\alpha _{2};n;Q}\rangle \sim \frac{q^{\lfloor n/2 \rfloor }}{\Phi (Q)}. \end{aligned}$$
(4.3)

In the rest of this section we will evaluate the variance of \({S}_{\alpha _{2};n;Q}\) i.e. the average of the squared difference between \({S}_{\alpha _{2};n;Q}\) and its mean value.

4.2 The case of small n

See also subsection 4.2 in [14]. If \(n<\deg Q\) then there is at most one polynomial \(f\in \mathbb {F}_q[T]\) of degree n such that \(f=A\mod Q\). In this case, when \(q \rightarrow \infty \)

$$\begin{aligned} Var({S}_{\alpha _{2};n;Q})\sim \frac{q^{n}}{\Phi (Q)}\langle \alpha _{2}\rangle _{n}. \end{aligned}$$
(4.4)

Indeed, if \(n<\deg Q\) we can use (4.3) to see that

$$\begin{aligned} |\langle {S}_{\alpha _{2};n;Q}\rangle |\ll _{n}\frac{1}{q^{n/2}}. \end{aligned}$$
(4.5)

Hence

$$\begin{aligned} Var({S}_{\alpha _{2};n;Q})= & {} \frac{1}{\Phi (Q)}\sum _{\begin{array}{c} A \mod Q\\ (A,Q)=1 \end{array}} |{S}_{\alpha _{2};n;Q}(A)|^{2}\left( 1+O\left( \frac{1}{q^{n/2}}\right) \right) \nonumber \\= & {} \frac{1}{\Phi (Q)}\sum _{\begin{array}{c} f\in \mathcal M_n\\ (f,Q)=1 \end{array}}|\alpha _{2}(f)|^{2}\left( 1+O\left( \frac{1}{q^{n/2}}\right) \right) \nonumber \\\sim & {} \frac{q^{n}}{\Phi (Q)}\langle \alpha _{2}\rangle _{n}\nonumber \\\sim & {} \frac{q^{\lfloor n/2 \rfloor }}{\Phi (Q)}. \end{aligned}$$
(4.6)

4.3 A formula for the variance

We present a formula for the variance of \({S}_{\alpha _{2};n;Q}\) using Dirichlet characters [14, §4.1]. We start with the following expansion, using the first orthogonality relation for Dirichlet characters (see (3.2)) to pick out an arithmetic progression:

$$\begin{aligned} {S}_{\alpha _{2},n,Q}(A) = \frac{1}{\Phi (Q)} \sum _{\begin{array}{c} f\in \mathcal M_n\\ (f,Q)=1 \end{array}} \alpha _{2}(f) + \frac{1}{\Phi (Q)} \sum _{\chi \ne \chi _0}\overline{\chi (A)} \mathcal M(n;\alpha _{2}\chi ), \end{aligned}$$
(4.7)

where

$$\begin{aligned} \mathcal M(n;\alpha _{2}\chi ) := \sum _{f\in M_{n}}\alpha _{2}(f)\chi (f) \;. \end{aligned}$$
(4.8)

Note that the contribution of the trivial character is equal to the average of \({S}_{\alpha _{2};n;Q}(A)\). Therefore

$$\begin{aligned} {S}_{\alpha _{2};n;Q}-\langle {S}_{\alpha _{2};n;Q}\rangle = \frac{1}{\Phi (Q)} \sum _{\chi \ne \chi _{0} \mod Q}\overline{\chi }(A)\mathcal M(n;\alpha _{2}\chi ). \end{aligned}$$
(4.9)

Using the above and the second orthogonality relation for Dirichlet characters (see (3.3)), we have the following expression for the variance:

$$\begin{aligned} Var({S}_{\alpha _{2};n;Q})=\langle |{S}_{\alpha _{2};n;Q}-\langle {S}_{\alpha _{2};n;Q}\rangle |^{2}\rangle =\frac{1}{\Phi (Q)^{2}}\sum _{\chi \ne \chi _{0}}|\mathcal M(n;\alpha _{2}\chi )|^{2}. \end{aligned}$$
(4.10)

4.4 The quadratic character and the cubic character

Next, we evaluate \(\mathcal M(n;\alpha _{2}\chi )\) for \(\chi =\chi _{2}\) a quadratic character and for \(\chi =\chi _{3}\) a cubic character. We assume here for simplicity that Q is prime polynomial. The sum \(\mathcal M(n;\alpha _{2}\chi )\) given by (4.8), is the coefficient of \(u^{n}\) in the expansion of \(\frac{L(u^{2},\chi ^{2})L(u^{3},\chi ^{3})}{L(u^{6},\chi ^{6})}.\) Thus for \(\chi =\chi _{2}\), the generating function of \(\mathcal M(n;\alpha _{2}\chi _{2})\) has the following form:

$$\begin{aligned} L(u^{3},\chi _{2})\cdot \frac{Z(u^{2})(1-u^{2\deg Q})}{Z(u^{6})(1-u^{6\deg Q})} \end{aligned}$$
(4.11)

recall that

$$\begin{aligned} Z(u)=\frac{1}{1-qu} \end{aligned}$$
(4.12)

and that

$$\begin{aligned} L(u,\chi )=\prod _{j=1}^{\deg Q -1}(1-\alpha _{j}(\chi )u), \end{aligned}$$
(4.13)

therefore by expanding and comparing coefficients while bearing in mind the Riemann hypothesis (3.12), we can see that for an even n the leading order coefficient in q come from \(Z(u^{2})\) and for odd n it comes from \(Z(u^{2})\) and \(L(u^{3},\chi _{2})\). Thus we get

$$\begin{aligned} \mathcal M(n;\alpha _{2}\chi _{2})\sim {\left\{ \begin{array}{ll} q^{\frac{n}{2}} &{} n {\text {even}},\\ -q^{\frac{n-3}{2}} \cdot \sum _{j=1}^{\deg Q -1}\alpha _{j}(\chi _{2}) &{} n {\text {odd}}, \end{array}\right. } \end{aligned}$$
(4.14)

where \(\alpha _{j}(\chi _{2})\) are the inverse roots of \(L(u,\chi _{2})\).

For \(\chi =\chi _{3}\), the generating function of \(\mathcal M(n;\alpha _{2}\chi _{3})\) has the following form:

$$\begin{aligned} L(u^{2},\chi _{3}^{2})\cdot \frac{Z(u^{3})(1-u^{3\deg Q})}{Z(u^{6})(1-u^{6\deg Q})} \end{aligned}$$
(4.15)

as before we get

$$\begin{aligned} \mathcal M(n;\alpha _{2}\chi _{3})\sim {\left\{ \begin{array}{ll} q^{\frac{n}{3}} &{} n =0 \mod 3,\\ q^{\frac{n-4}{3}} \cdot \sum _{j,l=1}^{\deg Q -1}\alpha _{j}(\chi _{3})\alpha _{l}(\chi _{3}) &{} n=1 \mod 3,\\ -q^{\frac{n-2}{3}} \cdot \sum _{j=1}^{\deg Q -1}\alpha _{j}(\chi _{3}) &{} n=2 \mod 3, \end{array}\right. } \end{aligned}$$
(4.16)

where \(\alpha _{j}(\chi _{3})\) are the inverse roots of \(L(u,\chi _{3})\).

4.5 Average of the sum \(\mathcal M(n;\alpha _{2}\chi )\)

Lemma 4.1

For a Dirichlet character \(\chi \) mod Q, such that \(\chi ^{2},\chi ^{3},\chi ^{6}\) are odd and primitive

$$\begin{aligned} \mathcal M(n;\alpha _{2}\chi )=\sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j \le N\\ 0\le l \le N\\ 0\le k \end{array}}q^{\frac{j+k+l}{2}}{\text {tr}}\Lambda _{j}(\Theta _{\chi ^{2}}){\text {tr}}\Lambda _{l}(\Theta _{\chi ^{3}}){\text {tr}}{\text {Sym}}^{k}(\Theta _{\chi ^{6}}), \end{aligned}$$
(4.17)

where \(N{:=}\deg Q -1\), \(\Theta _{\chi }\in U(N)\) is the unitarized Frobenius matrix, \({\text {Sym}}^{n}\) is the symmetric \(n-th\) power representation, and \(\Lambda _{n}\) is the exterior \(n-th\) power representation.

For \(\chi \ne \chi _{0},\chi _{2},\chi _{3}\) mod Q, the following bound holds:

$$\begin{aligned} |\mathcal M(n;\alpha _{2}\chi )|\ll _{\deg Q} \sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j \le N\\ 0\le l \le N\\ 0\le k \end{array}}q^{\frac{j+k+l}{2}}. \end{aligned}$$
(4.18)

Proof

The sum \(\mathcal M(n;\alpha _{2}\chi )\) given by (4.8), is the coefficient of \(u^{n}\) in the expansion of \(\frac{L(u^{2},\chi ^{2})L(u^{3},\chi ^{3})}{L(u^{6},\chi ^{6})}.\) For an odd primitive characters \(\chi \) mod Q, we use the Riemann Hypothesis (3.12) (Weil’s theorem) to write

$$\begin{aligned} L(u,\chi )=\det (I-uq^{\frac{1}{2}}\Theta _{\chi }). \end{aligned}$$
(4.19)

Since the coefficients of the characteristic polynomial of an \(N\times N\) matrix with eigenvalues \(\lambda _{1},\ldots , \lambda _{n}\) are the elementary symmetric functions \(\sum _{1\le i_{1}<\ldots <i_{r}}\lambda _{i_{1}}\cdots \lambda _{i_{r}}\) which give the character of the exterior power representation, we may write

$$\begin{aligned} L(u,\chi ) =\sum _{i=0}^{\deg Q-1}u^{i}q^{i/2}{\text {tr}}\Lambda _{i}(\Theta _{\chi }) \end{aligned}$$
(4.20)

and in the same way

$$\begin{aligned} \frac{1}{L(u,\chi )}=\frac{1}{\det (I-uq^{\frac{1}{2}}\Theta _{\chi })}=\sum _{i=0}^{\infty }u^{i}q^{i/2}{\text {tr}}{\text {Sym}}^{i}(\Theta _{\chi }). \end{aligned}$$
(4.21)

Abbreviate as follows:

$$\begin{aligned} \Lambda _{i}(\chi ):={\text {tr}}\Lambda _{i}(\Theta _{\chi }),~~~~~~~{\text {Sym}}^{i}(\chi )={\text {tr}}{\text {Sym}}^{i}(\Theta _{\chi }) \end{aligned}$$

to have

$$\begin{aligned} \frac{L(u^{2},\chi ^{2})L(u^{3},\chi ^{3})}{L(u^{6},\chi ^{6})}= \sum _{j=0}^{\deg Q-1}\sum _{l=0}^{\deg Q-1}\sum _{k=0}^{\infty }u^{2j+3l+6k}q^{\frac{j+k+l}{2}}\Lambda _{j}(\chi ^{2})\Lambda _{l}(\chi ^{3})Sym^{k}(\chi ^{6}).\nonumber \\ \end{aligned}$$
(4.22)

Hence the coefficient of \(u^{n}\) is indeed given by (4.17).

For \(\chi \ne \chi _{0},\chi _{2},\chi _{3}\) mod Q for which at least one of \(\chi ^{2},\chi ^{3},\chi ^{6}\) is not primitive or not odd, we still have \(L(u,\chi )=\prod _{j=1}^{\deg Q-1}(1-\alpha _{j}(\chi )u)\) with all the inverse roots \(|\alpha _{j}(\chi )|=q^{\frac{1}{2}}\) or \(|\alpha _{j}(\chi )|=1\) , and hence we obtain (4.18). \(\square \)

Next, we want to evaluate \(\sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j \le N\\ 0\le l \le N\\ 0\le k \end{array}}q^{j+k+l}\). Denote

$$\begin{aligned} {S}(n):=\sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j \le N\\ 0\le l \le N\\ 0\le k \end{array}}q^{j+k+l}. \end{aligned}$$
(4.23)

Lemma 4.2

Let \(N:=\deg Q - 1\) then in the limit \(q\rightarrow \infty \),

for \(0\le n\le 2N\)

$$\begin{aligned} {S}(n)\sim q^{\left\lfloor \frac{n}{2}\right\rfloor }, \end{aligned}$$
(4.24)

for \(2N< n\le 5N\)

$$\begin{aligned} {S}(n)\sim q^{\left\lfloor \frac{n+N}{3}\right\rfloor }, \end{aligned}$$
(4.25)

for \(5N< n\)

$$\begin{aligned} {S}(n)\sim q^{\frac{n+N}{6}}\cdot q^{\frac{-\lambda _{n}}{6}}, \end{aligned}$$
(4.26)

where

$$\begin{aligned} \lambda _{n}= {\left\{ \begin{array}{ll} 0 &{} n=5N \mod 6,\\ 7 &{} n=5N+1 \mod 6,\\ 6 &{} n=5N+2 \mod 6,\\ 3 &{} n=5N+3 \mod 6,\\ 4 &{} n=5N+4 \mod 6,\\ 11 &{} n=5N+5 \mod 6. \end{array}\right. } \end{aligned}$$
(4.27)

Proof

In order to find the leading order term of \(\textit{S}(n)\) we need first to take the maximal possible j and then the maximal possible l which satisfy \(2j+3l+6k=n, 0\le j \le N, 0\le l \le N\) (note that k will then be determined).

In the first case \(0\le n \le 2N\) if 2 divides n then \(j=n/2,l=0,k=0\) will clearly give the leading order term. If 2 does not divide n then \(j=(n-3)/2,l=1,k=0\) will give the leading order term.

In the second case \(2N< n \le 5N\), we write \(j=N-i_{j}\) and then we have \(n-2N=6k+3l-2i_{j}\) and so clearly the values for \(k,l,i_{j}\) that will give the leading order term, depend on the value of \(n-2N \mod 3\) (or equivalently \(n+N \mod 3\)). Here our first priority is to minimize \(i_{j}\) and then to maximize l. The leading order term will be given by \(q^{\frac{n+N-i_{j}}{3}-\frac{k}{2}}\) which gives \(q^{\left\lfloor \frac{n+N}{3}\right\rfloor }.\)

In the last case \(5N< n\), we write \(j=N-i_{j}\) and \(l=N-i_{l}\), then we have \(n-5N=6k-3i_{l}-2i_{j}\) and so clearly the values for \(k,i_{l},i_{j}\) that will give the leading order term, depend on the value of \(n-5N \mod 6\). Here our first priority is to minimize \(i_{j}\) and then to minimize \(i_{l}\). The leading order term will be given by \(q^{\frac{n+7N-3i_{l}-4i_{j}}{6}}\). Note that in the notations of Eqs. (4.26) and (4.27) we have \(4i_{j}+3i_{l}=\lambda _{n}\) \(\square \)

4.6 Proof of Theorem 2.1

Recall that by Lemma 3.2, we have that the number of characters which are not in \(\Gamma _{d-prim}^{d-odd}(Q)\) is \(O(\frac{\Phi (Q)}{q})\) when \(q\rightarrow \infty .\) Therefore, by using the formula for the variance that was given in (4.10) we may write

$$\begin{aligned} Var({S}_{\alpha _{2};n;Q})= & {} \frac{1}{\Phi (Q)^{2}}\sum _{\begin{array}{c} \chi \ne \chi _{0} \\ \chi \in \Gamma _{6-prim}^{6-odd}(Q) \end{array}}|\mathcal M(n;\alpha _{2}\chi )|^{2} +\frac{1}{\Phi (Q)^{2}}|\mathcal M(n;\alpha _{2}\chi _{2})|^{2}\nonumber \\&+\,\lambda _{3}\frac{1}{\Phi (Q)^{2}}|\mathcal M(n;\alpha _{2}\chi _{3})|^{2} + O\left( \frac{\textit{S}(n)}{\Phi (Q)q}\right) , \end{aligned}$$
(4.28)

where \(\lambda _{3}=2\) if \(|Q|=1 \mod 3\), and zero otherwise. Note that we assume Q is prime and that the characteristic of the field \(\mathbb {F}_q\) is odd therefore there is one quadratic character mod Q and either two or zero cubic characters, depending on whether \(|Q|=1 \mod 3\) or not.

For the first sum in (4.28), use (4.17) to have

$$\begin{aligned}&\frac{1}{\Phi (Q)^{2}}\sum _{\begin{array}{c} \chi \ne \chi _{0} \\ \chi \in \Gamma _{6-prim}^{6-odd}(Q) \end{array}}|\mathcal M(n;\alpha _{2}\chi )|^{2}\nonumber \\&\quad = \frac{1}{\Phi (Q)^{2}}\sum _{\begin{array}{c} \chi \ne \chi _{0} \\ \chi \in \Gamma _{6-prim}^{6-odd}(Q) \end{array}}\left| \sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j \le N\\ 0\le l \le N\\ 0\le k \end{array}}q^{\frac{j+k+l}{2}}\Lambda _{j}(\chi ^{2})\Lambda _{l}(\chi ^{3})Sym^{k}(\chi ^{6})\right| ^2. \end{aligned}$$
(4.29)

We can use now the equidistribution result given in Theorem 3.8, to have

$$\begin{aligned}&\frac{1}{\Phi (Q)^{2}}\sum _{\begin{array}{c} \chi \ne \chi _{0} \\ \chi \in \Gamma _{6-prim}^{6-odd}(Q) \end{array}}\left| \sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j \le N\\ 0\le l \le N\\ 0\le k \end{array}}q^{\frac{j+k+l}{2}}\Lambda _{j}(\chi ^{2})\Lambda _{l}(\chi ^{3})Sym^{k}(\chi ^{6})\right| ^2 \nonumber \\&\quad \sim \frac{1}{\Phi (Q)}\iiint _{U(N)}\left| \sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j \le N\\ 0\le l \le N\\ 0\le k \end{array}}q^{\frac{j+k+l}{2}}{\text {tr}}\Lambda _{j}(U_{1}){\text {tr}}\Lambda _{l}(U_{2}){\text {tr}}{\text {Sym}}^{k}(U_{3})\right| ^2 \,dU_{1}\,dU_{2}\,dU_{3}\nonumber \\&\quad =\frac{1}{\Phi (Q)}\sum _{\begin{array}{c} 2j_{1}+3l_{1}+6k_{1}=n\\ 2j_{1}+3l_{1}+6k_{1}=n\\ 0\le j_{1},j_{2} \le N\\ 0\le l_{1},l_{2} \le N\\ 0\le k_{1},k_{2} \end{array}}q^{\frac{j_{1}+k_{1}+l_{1}+j_{2}+k_{2}+l_{2}}{2}}\times \int _{U(N)}{\text {tr}}\Lambda _{j_{1}}(U_{1})\overline{{\text {tr}}\Lambda _{j_{2}}(U_{1})}\,dU_{1}\nonumber \\&\qquad \times \int _{U(N)}{\text {tr}}\Lambda _{l_{1}}(U_{2})\overline{{\text {tr}}\Lambda _{l_{2}}(U_{2})}\,dU_{2}\times \int _{U(N)}{\text {tr}}{\text {Sym}}^{k_{1}}(U_{3})\overline{{\text {tr}}{\text {Sym}}^{k_{2}}(U_{3})}\,dU_{3} \end{aligned}$$
(4.30)

It is well known that \(\Lambda _{j}\) are distinct irreducible representations of the unitary group U(N), and hence one gets

$$\begin{aligned} \int _{U(N)}{\text {tr}}\Lambda _{j}(U)\overline{{\text {tr}}\Lambda _{i}(U)}dU=\delta _{j,i}. \end{aligned}$$
(4.31)

It is also well known that \(Sym^{j}\) are distinct irreducible representations of the unitary group U(N), hence

$$\begin{aligned} \int _{U(N)}{\text {tr}}{\text {Sym}}^{j}(U)\overline{{\text {tr}}{\text {Sym}}^{i}(U)}dU=\delta _{j,i}. \end{aligned}$$
(4.32)

Therefore

$$\begin{aligned} \frac{1}{\Phi (Q)^{2}}\sum _{\begin{array}{c} \chi \ne \chi _{0} \\ \chi \in \Gamma _{6-prim}^{6-odd}(Q) \end{array}}|\mathcal M(n;\alpha _{2}\chi )|^{2} \sim \frac{1}{\Phi (Q)}\sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j \le N\\ 0\le l \le N\\ 0\le k \end{array}}q^{j+k+l}. \end{aligned}$$
(4.33)

The contribution from the second and third summands was evaluated in Subsect. 4.4. Adding up everything and checking for the leading order terms by using Lemma 4.2 finishes the proof.

5 The variance over short intervals

5.1 The mean value

The mean value of \(\mathcal N_{\alpha _{2};h}\) when we average over \(A\in \mathcal M_n\) is

$$\begin{aligned} \langle \mathcal N_{\alpha _{2};h} \rangle:= & {} \frac{1}{q^{n}} \sum _{A\in \mathcal M_n} \mathcal N_{\alpha _{2};h}(A) \nonumber \\= & {} \frac{1}{q^{n}} \sum _{A\in \mathcal M_n}\sum _{f\in I(A;h)}\alpha _{2}(f) \nonumber \\= & {} q^{h+1}\frac{1}{q^{n}} \sum _{f\in \mathcal M_n}\alpha _{2}(f) \nonumber \\= & {} q^{h+1}\langle \alpha _{2} \rangle _{n}. \end{aligned}$$
(5.1)

By (2.8) we have in the limit \(q\rightarrow \infty \)

$$\begin{aligned} \langle \mathcal N_{\alpha _{2};h} \rangle \sim H\cdot q^{\lfloor n/2 \rfloor -n}, \end{aligned}$$
(5.2)

where \(H=\#I(A;h)=q^{h+1}\). In the rest of this section we will evaluate the variance of \(\mathcal N_{\alpha _{2};h}\) i.e. the average of the squared difference between \(\mathcal N_{\alpha _{2};h}\) and its mean value.

5.2 An expression for the variance

To begin the proof of Theorem 2.2, we express the variance of the short interval sums \(\mathcal N_{\alpha _{2};h}\) in terms of sums of the function \(\alpha _{2}\), twisted by primitive even Dirichlet characters, similarly to what was done in the previous section.

Lemma 5.1

As \(q \rightarrow \infty \)

$$\begin{aligned} {\text {Var}}(\mathcal N_{\alpha _{2};h}) = \frac{H}{q^n} \frac{1}{\Phi ^{ev}(T^{n-h})} \sum _{\begin{array}{c} \chi \bmod T^{n-h}\\ \chi \ne \chi _{0} \;\mathrm{even } \end{array}} \sum _{\begin{array}{c} m_{1},m_{2}=0\\ m_{1},m_{2}\ne n-1 \end{array}}^{n}\mathcal M(m_{1};\alpha _{2}\chi )\overline{\mathcal M(m_{2};\alpha _{2}\chi )}, \end{aligned}$$
(5.3)

where the definition of \(\mathcal M(n;\alpha _{2}\chi )\) was first given in (4.8)

$$\begin{aligned} \mathcal M(n;\alpha _{2}\chi ) := \sum _{f\in M_{n}}\alpha _{2}(f)\chi (f) \;. \end{aligned}$$
(5.4)

Proof

To compute the variance, we use [14, Lemma 5.4] which gives an expression for the variance of sums over short intervals of certain arithmetic functions \(\alpha \) which are “even” (\(\alpha (cf)=\alpha (f)\) for \(c\in \mathbb {F}_q^\times \)), multiplicative, and symmetric under the map \(f^*(t):=t^{\deg f}f(\frac{1}{t})\), in the sense that

$$\begin{aligned} \alpha (f^*) = \alpha (f), \quad \mathrm{if}\; f(0)\ne 0 \;. \end{aligned}$$
(5.5)

Since the indicator function for square full polynomials \(\alpha _{2}\) clearly satisfies all of these conditions, we may use [14, Lemma 5.4] to obtain

$$\begin{aligned} {\text {Var}}(\mathcal N_{\alpha _{2};h})= & {} \frac{H}{q^n} \sum _{m_1,m_2=0}^n \alpha _{2}(T^{n-m_1}) \overline{\alpha _{2}(T^{n-m_2})} \nonumber \\&\times \frac{1}{\Phi ^{ev}(T^{n-h})} \sum _{\begin{array}{c} \chi \bmod T^{n-h}\\ \chi \ne \chi _0\, \mathrm{even} \end{array}} \mathcal M(m_1;\alpha _{2}\chi ) \overline{\mathcal M(m_2;\alpha _{2}\chi )}. \end{aligned}$$
(5.6)

By the definition of \(\alpha _{2}\) we have \(\alpha _{2}(T^{n-m})=1\) when \(m\ne n-1\) and \(\alpha _{2}(T^{n-m})=0\) when \(m= n-1\), hence (5.3) follows. \(\square \)

To compute the variance, we need to obtain an expression for \(\mathcal M(n;\alpha _{2}\chi )\). Consider the generating function

$$\begin{aligned} \sum _{n=0}^{\infty }\mathcal M(n;\alpha _{2}\chi )u^{n}=\frac{L(u^{2},\chi ^{2})L(u^{3},\chi ^{3})}{L(u^{6},\chi ^{6})}. \end{aligned}$$
(5.7)

For an even primitive characters \(\chi \) mod \(T^{n-h}\), \(L(u,\chi )\) has a trivial zero at \(u=1\), hence we may write

$$\begin{aligned} L(u,\chi )=(1-u)\det (I-uq^{\frac{1}{2}}\Theta _{\chi })=(1-u)\sum _{i=0}^{n-h-2}u^{i}q^{i/2}{\text {tr}}\Lambda _{i}(\Theta _{\chi }) \end{aligned}$$
(5.8)

and

$$\begin{aligned} \frac{1}{L(u,\chi )}=\frac{1}{(1-u)\det (I-uq^{\frac{1}{2}}\Theta _{\chi })}=\frac{1}{(1-u)}\sum _{i=0}^{\infty }u^{i}q^{i/2}{\text {tr}}Sym^{i}(\Theta _{\chi }). \end{aligned}$$
(5.9)

Therefore, the generating function of \(\mathcal M(n;\alpha _{2}\chi )(\)i.e. \(\frac{L(u^{2},\chi ^{2})L(u^{3},\chi ^{3})}{L(u^{6},\chi ^{6})}\)) for \(\chi \) mod \(T^{n-h}\) such that \(\chi ^{2}, \chi ^{3}, \chi ^{6}\) are primitive and even can be written as follows:

$$\begin{aligned}&\frac{(1-u^{2})(1-u^{3})\det (I-u^{2}q^{\frac{1}{2}}\Theta _{\chi ^{2}})\det (I-u^{3}q^{\frac{1}{2}}\Theta _{\chi ^{3}})}{(1-u^{6})\det (I-u^{6}q^{\frac{1}{2}}\Theta _{\chi ^{6}})}\nonumber \\&\quad =\frac{(1-u^{2})}{(1+u^{3})} \sum _{j=0}^{n-h-2}\sum _{l=0}^{n-h-2}\sum _{k=0}^{\infty }u^{2j+3l+6k}q^{\frac{j+k+l}{2}}\Lambda _{j}(\chi ^{2})\Lambda _{l}(\chi ^{3})Sym^{k}(\chi ^{6}). \end{aligned}$$
(5.10)

By expanding and comparing coefficients we have

$$\begin{aligned} \mathcal M(m;\alpha _{2}\chi )=\mathcal {S'}_{\chi }(m)-\mathcal {S'}_{\chi }(m-2), \end{aligned}$$
(5.11)

where for \(1\ne m\ge 0\)

$$\begin{aligned} \mathcal {S'}_{\chi }(m):=\sum _{\begin{array}{c} 2j+3l+6k+3i=m\\ 0\le j,l \le n-h-2 \\ 0\le k,i \end{array}}(-1)^{i}q^{\frac{j+k+l}{2}}\Lambda _{j}(\chi ^{2})\Lambda _{l}(\chi ^{3})Sym^{k}(\chi ^{6}) \end{aligned}$$
(5.12)

and

$$\begin{aligned} \mathcal {S'}_{\chi }(1),\mathcal {S'}_{\chi }(-1),\mathcal {S'}_{\chi }(-2):=0. \end{aligned}$$
(5.13)

Now back to the variance formula (see (5.3)), we can split the sum into two parts: the sum over \(\chi \ne \chi _{0} \mod T^{n-h},\chi \in \Gamma _{prim}^{ev}(T^{n-h})\) and the sum over even non-primitive characters mod \(T^{n-h}\). We start by considering the first sum which will give the main term since most of the even characters are also primitive. With the second sum which will give an error term we deal later. Note: by Lemma 3.4 it is enough to split to these sums, and we can still use (5.9) and (5.8) for \(\chi ^{2},\chi ^{3},\chi ^{6}.\)

For \(\chi \) even and primitive, consider the inner sum in the variance formula:

$$\begin{aligned}&\sum _{\begin{array}{c} m_{1},m_{2}=0\\ m_{1},m_{2}\ne n-1 \end{array}}^{n}\mathcal M(m_{1};\alpha _{2}\chi )\overline{\mathcal M(m_{2};\alpha _{2}\chi )}\nonumber \\&\quad = \sum _{m_{1},m_{2}=0}^{n-2}\mathcal M(m_{1};\alpha _{2}\chi )\overline{\mathcal M(m_{2};\alpha _{2}\chi )}+|\mathcal M(n;\alpha _{2}\chi )|^{2}\nonumber \\&\qquad +\,\overline{\mathcal M(n;\alpha _{2}\chi )}\sum _{m=0}^{n-2}\mathcal M(m;\alpha _{2}\chi )+\mathcal M(n;\alpha _{2}\chi )\sum _{m=0}^{n-2}\overline{\mathcal M(m;\alpha _{2}\chi )}. \end{aligned}$$
(5.14)

The sum over \(\mathcal M(m;\alpha _{2}\chi )\) equals

$$\begin{aligned} \sum _{m=0}^{n-2}\mathcal M(m;\alpha _{2}\chi )= & {} \sum _{m=0}^{n-2}(\mathcal {S'}_{\chi }(m)-\mathcal {S'}_{\chi }(m-2)) \nonumber \\= & {} (\mathcal {S'}_{\chi }(n-2)+\mathcal {S'}_{\chi }(n-3)). \end{aligned}$$
(5.15)

Hence we get

$$\begin{aligned} \sum _{\begin{array}{c} m_{1},m_{2}=0\\ m_{1},m_{2}\ne n-1 \end{array}}^{n}\mathcal M(m_{1};\alpha _{2}\chi )\overline{\mathcal M(m_{2};\alpha _{2}\chi )}&=|\mathcal {S'}_{\chi }(n)|^{2}+|\mathcal {S'}_{\chi }(n-3)|^{2} +\mathcal {S'}_{\chi }(n-3)\overline{\mathcal {S'}_{\chi }(n)} \nonumber \\&\quad +\overline{\mathcal {S'}_{\chi }(n-3)}\mathcal {S'}_{\chi }(n). \end{aligned}$$
(5.16)

By the definition of \(\mathcal {S'}_{\chi }(n)\) (see (5.12)) we may rewrite it for \(n\ge 3\) in the following way

$$\begin{aligned} \mathcal {S}'_{\chi }(n)=\sum _{\begin{array}{c} 2j+3l+6k+3i=n-3\\ 0\le j,l \le n-h-2 \\ 0\le k\\ -1 \le i \end{array}}(-1)^{i+1}q^{\frac{j+k+l}{2}}\Lambda _{j}(\chi ^{2})\Lambda _{l}(\chi ^{3})Sym^{k}(\chi ^{6}). \end{aligned}$$
(5.17)

Now split the above into two sums, the sum over \(i\ge 0\) and the sum over \(i=-1\)

$$\begin{aligned}&\sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j,l \le n-h-2 \\ 0\le k \end{array}}q^{\frac{j+k+l}{2}}\Lambda _{j}(\chi ^{2})\Lambda _{l}(\chi ^{3})Sym^{k}(\chi ^{6}) \nonumber \\&\quad \quad - \sum _{\begin{array}{c} 2j+3l+6k+3i=n-3\\ 0\le j,l \le n-h-2 \\ 0\le k,i \end{array}}(-1)^{i}q^{\frac{j+k+l}{2}}\Lambda _{j}(\chi ^{2})\Lambda _{l}(\chi ^{3})Sym^{k}(\chi ^{6}). \end{aligned}$$
(5.18)

Denote the first sum by \(H_{\chi }(n)\)

$$\begin{aligned} H_{\chi }(n):=\sum _{\begin{array}{c} 2j+3l+6k=n\\ 0\le j,l \le n-h-2 \\ 0\le k \end{array}}q^{\frac{j+k+l}{2}}\Lambda _{j}(\chi ^{2})\Lambda _{l}(\chi ^{3})Sym^{k}(\chi ^{6}) \end{aligned}$$
(5.19)

to have

$$\begin{aligned} \mathcal {S'}_{\chi }(n)=H_{\chi }(n)-\mathcal {S'}_{\chi }(n-3). \end{aligned}$$
(5.20)

By plugging this into (5.16) we can see that most of the terms cancel and we are left only with

$$\begin{aligned} \sum _{\begin{array}{c} m_{1},m_{2}=0\\ m_{1},m_{2}\ne n-1 \end{array}}^{n}\mathcal M(m_{1};\alpha _{2}\chi )\overline{\mathcal M(m_{2};\alpha _{2}\chi )}= |H_{\chi }(n)|^{2}. \end{aligned}$$
(5.21)

Hence the contribution from even primitive characters to the variance formula (see (5.3)) is

$$\begin{aligned} \frac{H}{q^n} \frac{1}{\Phi ^{ev}(T^{n-h})} \sum _{\begin{array}{c} \chi \mod T^{n-h}\\ \chi \ne \chi _{0} \in \Gamma _{prim}^{ev} \end{array}}|H_{\chi }(n)|^{2}. \end{aligned}$$
(5.22)

Note that there is a unique solution to \(2j+3l+6k=n\), \(0\le j,l\le n-h-2\), \(0\le k\) that maximizes the quantity \(j+l+k\) (Lemma 4.2). Denote this solution by \(j',l',k'\), to have

$$\begin{aligned} \sum _{\begin{array}{c} \chi \mod T^{n-h}\\ \chi \ne \chi _{0} \in \Gamma _{prim}^{ev} \end{array}}|H_{\chi }(n)|^{2}= & {} \sum _{\begin{array}{c} \chi \mod T^{n-h}\\ \chi \ne \chi _{0} \in \Gamma _{prim}^{ev} \end{array}}q^{j'+l'+k'}|\Lambda _{j'}(\chi ^{2})\Lambda _{l'}(\chi ^{3})Sym^{k'}(\chi ^{6})|^{2}\nonumber \\&+\sum _{\begin{array}{c} \chi \mod T^{n-h}\\ \chi \ne \chi _{0} \in \Gamma _{prim}^{ev} \end{array}}g(\chi ,j',l',k'), \end{aligned}$$
(5.23)

where \(g(\chi ,j',l',k')\) is defined to be the sum over all the other terms. Clearly \(g(\chi ,j',l',k')\) is of lower order of q by the choice of \(j',l',k'\) therefore its contribution is negligible. The first term here will give the main term in the variance expression. By using the equidistribution result (Theorem 3.6) we get

$$\begin{aligned}&\frac{1}{\Phi ^{ev}(T^{n-h})}\sum _{\begin{array}{c} \chi \mod T^{n-h}\\ \chi \ne \chi _{0} \in \Gamma _{prim}^{ev} \end{array}} |\Lambda _{j'}(\chi ^{2})\Lambda _{l'}(\chi ^{3})Sym^{k'}(\chi ^{6})|^{2}\nonumber \\&\quad \sim \iiint _{PU(n-h-2)} |{\text {tr}}\Lambda _{j'}(U_{1}){\text {tr}}\Lambda _{l'}(U_{2}){\text {tr}}{\text {Sym}}^{k'}(U_{3})|^{2}\,dU_{1}\,dU_{2}\,dU_{3}. \end{aligned}$$
(5.24)

We may pass from the projective unitary group \(PU(n-h-2)\) to the unitary group because the function \(|{\text {tr}}\Lambda _{j'}(U_{1}){\text {tr}}\Lambda _{l'}(U_{2}){\text {tr}}{\text {Sym}}^{k'}(U_{3})|^{2}\) being averaged is invariant under scalar multiplication. Then, by (4.31) and (4.32), we conclude that the contribution of the first term to the variance is

$$\begin{aligned} \frac{H}{q^n} \frac{1}{\Phi ^{ev}(T^{n-h})} \sum _{\begin{array}{c} \chi \mod T^{n-h}\\ \chi \ne \chi _{0} \in \Gamma _{prim}^{ev} \end{array}}q^{j'+l'+k'}|\Lambda _{j'}(\chi ^{2})\Lambda _{l'}(\chi ^{3})Sym^{k'}(\chi ^{6})|^{2}\sim \frac{H}{q^n}q^{j'+l'+k'} \end{aligned}$$
(5.25)

this combined with Lemma 4.2 (with \(N=n-h-2\)) gives the main term.

Now, in order to complete the proof, it remains to bound the contribution of the even characters which are non-primitive to the variance. Note that we do not have quadratic or cubic characters here since \(\Phi ^{ev}(T^{m})=q^{m-1}\) and we are considering the case of characteristic bigger than 13 (see Theorem 3.6), therefore there cannot be any even characters mod \(T^{m}\) of order 2 or 3. For even characters which are non-primitive we still have the bound (4.18) with \(N=n-h-2\), and since their proportion is O(1 / q) in the set of even characters, then we can bound their contribution as in the previous section, therefore we skip the verification.

Acknowledgements

The author gratefully acknowledges support under EPSRC Programme Grant EP/K034383/1 LMF: L-Functions and Modular Forms. The author would like to thank Zeev Rudnick for suggesting this problem and to both Jon Keating and Zeev Rudnick for helpful discussions and remarks. The author would also like to thank Ofir Gorodetsky for an important observation, and to the referees for their comments.

Competing interests

The author declares that she has no competing interests.