1 Introduction

Let f be a modular form of weight \(k \in 2{\mathbb {Z}}\) and level N such that it has a Fourier expansion

$$\begin{aligned} f(z)=\sum _{n=1}^{\infty }a(n) e^{2\pi i n z}, \quad \Im (z) \ge 0, \end{aligned}$$

with a(n) be the nth Fourier coefficient. In this article, we shall restrict to the family of modular forms with rational coefficients, that is, f(z) with \(a(n)\in {\mathbb {Q}}\) for every n. We first consider Hecke eigenforms or simply eigenforms in the space of cusp forms of weight k for the congruence subgroup \(\Gamma _1(N)\) with trivial nebentypus. When f is an eigenform with integer Fourier coefficients, it follows from Deligne-Serre that for any prime \(\ell ,\) there exists a corresponding Galois representation

$$\begin{aligned} \rho _f^{(\ell )}:\mathrm{Gal}\left( \overline{{\mathbb {Q}}}/ {\mathbb {Q}}\right) \longrightarrow \mathrm{GL}_2 \left( {\mathbb {Z}}_{\ell }\right) \end{aligned}$$

such that \(\text {tr}(\rho _f^{(\ell )}(\text {Frob}_p))=a(p),\) for any prime \(p \not \mid N\ell .\) For a quick reference about this correspondence, we refer the interested reader to [8, Chapter 3].

In particular, \(a(p)\,(\mathrm{mod}\,\ell )\) is determined by the trace of the corresponding Frobenius element in \(\text {GL}_2({\mathbb {Z}}_{\ell }/\ell {\mathbb {Z}}_{\ell }) =\text {GL}_2({\mathbb {F}}_{\ell }).\) In certain cases, Chebotarev’s density theorem implies that given any \(\lambda \in {\mathbb {F}}_{\ell },\) there exists a prime p such that \(a(p)\equiv \lambda \,(\mathrm{mod} \,\ell ).\) However, the set of such primes p come with density strictly less than 1. So what about the other primes p? In this context, we address the following Waring-type question.

Question

Does there exist an absolute constant s such that for any given primes p and \(\ell ,\) any element of \({\mathbb {F}}_{\ell }\) can be written as a sum of at most s elements of the set \(\{a(p^n)\}_{n \ge 1}?\)

A related question was studied by Shparlinski in [24] for the Ramanujan’s \(\tau \) function, where \(\tau (n)\) is defined by the identity

$$\begin{aligned} \Delta (z)=q\prod _{n\ge 1}(1-q^n)^{24} = \sum _{n\ge 1}\tau (n)q^n, \quad \mathrm{with}\,\, q=\mathrm{exp}(2 \pi i z). \end{aligned}$$

In [24], it is proved that the set \(\{\tau (n)\}_{n\ge 1}\) is an additive basis modulo any prime \(\ell ,\) that is, there exists an absolute constant s such that the Waring-type congruence

$$\begin{aligned} \tau (n_1)+\cdots + \tau (n_s) \equiv \lambda \,(\mathrm{mod}\,\ell ) \end{aligned}$$

is solvable for any residue class \(\lambda \,(\mathrm{mod}\,\ell ).\)

Shparlinski’s work was later generalized by Garaev, García and Konyagin over the global field \({\mathbb {Q}}.\) More precisely, in [10], the authors proved that for any \(\lambda \in {\mathbb {Z}}\), the equation

$$\begin{aligned} \sum _{i=1}^{s}\tau (n_i)=\lambda \end{aligned}$$

always has a solution for \(s=\)74,000.

Later García and Nicolae [12] extended this result for coefficients a(n) of normalized Hecke eigenforms of weight k in \(S_k^{\mathrm{new}}(\Gamma _0(N))\). More precisely, they proved that for any \(\lambda \in {\mathbb {Z}}\), the equation

$$\begin{aligned} \sum _{i=1}^{s}a(n_i)=\lambda \end{aligned}$$

always has a solution for some \(s \le c(f)\) with c(f) satisfying

$$\begin{aligned} c(f)\ll (2N^{3/8})^{\tfrac{k-1}{2} + \varepsilon } k^{\tfrac{3}{16}k +O(1) + \varepsilon } \log (k+1). \end{aligned}$$

The proof of the above two results are connected to the identity \(a(p^2)= a^2(p)-p^{k-1}\) and the solubility of the equation

$$\begin{aligned} p^{k-1}_1 + \cdots + p^{k-1}_s = N, \quad \mathrm{for}\ \mathrm{primes} \, p_1,\ldots , p_s. \end{aligned}$$

We are studying the finite field version of this additivity problem by obtaining nontrivial exponential sums associated with coefficients of modular forms, in the sense of [24]. We are working with the class of forms that García and Nicolae [12] considered, but with Fourier coefficients evaluated only at prime powers. Our results are recorded in Corollaries 15 and 16. Our main tool is Theorem 1 which provides a nontrivial bound for exponential sums with coefficients of modular forms. To study this problem, we shall primarily focus on the exponential sums of type

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau }{\mathbf {e}}_{\ell }\left( {\xi a(p^n) }\right) \right| \end{aligned}$$

where \(p,\ell \) are primes, and \(\tau \) is a suitable parameter which we shall specify later. This is done in Theorems 2 and 3.

When f is a normalized eigenform, it is well known that a(n) is a multiplicative function and for any prime \(p\not \mid N\) satisfies the relation

$$\begin{aligned} a(p^{n+2})=a(p)a(p^{n+1})-p^{k-1}a(p^n),\quad n\ge 0. \end{aligned}$$
(1)

Moreover, we have \(a(p^n)=a(p)^n\) for any prime \(p\mid N\). These facts come from the properties of Hecke operators, see  [5, Proposition 5.8.5]. If \(a(p) \in {\mathbb {Q}},\) then one can consider \(a(p) \,(\mathrm{mod}\,\ell ) \in {\mathbb {F}}_{\ell }\) naturally for any large enough prime \(\ell .\) For instance, \(\ell \) can be taken to be any prime not dividing the denominators of the Fourier coefficients. On the other hand, any cuspform can be uniquely written as a \({\mathbb {C}}\)-linear combination of pairwise orthogonal eigenforms with Fourier coefficients coming from \({\mathbb {C}}\). See [5, Chapter 5] for a brief review of the Hecke theory of modular forms. However, here we are concerned with all such cuspforms which can be uniquely written as a \({\mathbb {Q}}\)-linear combination of pairwise orthogonal eigenforms with Fourier coefficients coming from \({\mathbb {Q}}\). Note that, in this case, the sequence \(\{a(p^n)\}\) is a linear recurrence sequence of possibly higher degree. We now turn to discuss the basic theory of linear recurrence sequences. We will also discuss the bounds of their associated exponential sums.

1.1 Linear recurrence sequences and exponential sums

Let \(r\ge 1\) be an integer and p be an arbitrary prime number. A linear recurrence sequence \(\{s_n\}\) of order r in \({\mathbb {F}}_p\) consists of a recursive relation

$$\begin{aligned} s_{n+r}\equiv a_{r-1} s_{n+r-1} + \cdots + a_0 s_n \,(\mathrm{mod}\,p), \quad \mathrm{with}\ n=0,1,2, \ldots \,, \end{aligned}$$
(2)

and initial values \(s_0, \ldots , s_{r-1} \in {\mathbb {F}}_p.\) Here \(a_0, \ldots , a_{r-1} \in {\mathbb {F}}_p\) are fixed. The characteristic polynomial \(\omega (x)\) associated to \(\{s_n\}\) is

$$\begin{aligned} \omega (x)=x^{r}- a_{r-1}x^{r-1}- \cdots - a_1 x - a_{0}. \end{aligned}$$

We see from Eq. (1) that \(\{a(p^n)\}\) is a linear recurrence sequence of order 2 when f is an eigenform. We shall prove the results in Sect. 2, by studying exponential sums associated to a much more general class of linear recurrence sequences.

Under certain assumptions, linear recurrence sequences become periodic modulo p, see [15, Lemma 6.4] and [18, Theorem 6.11].

Let p be a prime number and \(\omega (x)\) be the characteristic polynomial of a linear recurrence sequence \(\{ s_n\}\) defined by Eq. (2). If \((a_0,p)=1\) and at least one of the \(s_0, \ldots , s_{r-1}\) are not divisible by p,  then the sequence \(\{s_n\}\) is periodic modulo p,  that is for some \(T\ge 1\),

$$\begin{aligned} s_{n+T}\equiv s_n \,(\mathrm{mod}\,p), \qquad n=0,1,2,\ldots \, . \end{aligned}$$

The least positive period is denoted by \(\tau .\) Moreover, \( \tau \le p^r-1\) and \(\tau \) divides T for any period \(T \ge 1\) of the sequence \(\{s_n\}.\)

In 1953, Korobov [16] obtained bounds for rational exponential sums involving linear recurrence sequences in residue classes. In particular, for the fields of order p,  if \(\{s_n\}\) is a linear recurrence sequence of order r with \((a_0,p)=1\) and period \(\tau \), it follows that

$$\begin{aligned} \left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {s_n}\right) \right| \le p^{r/2}. \end{aligned}$$
(3)

Note that such a bound is nontrivial if \(p^{r/2}< \tau \) and asymptotically effective only if \(p^{r/2} / \tau \rightarrow 0\) as \(p\rightarrow \infty .\) Estimate (3) is optimal in general terms, indeed Korobov [15] showed that there is a linear recurrence sequence \(\{s_n\}\) with length r satisfying

$$\begin{aligned} \frac{1}{2} p^{r/2} < \left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {s_n}\right) \right| \le p^{r/2}. \end{aligned}$$

In turn, for any given \(\varepsilon >0\), it has been proved that there exists a class of linear recurrence sequences with a better upper bound

$$\begin{aligned} \left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {s_n}\right) \right| \le \tau ^{1/2+ \varepsilon }. \end{aligned}$$

However, the proof of the existence is ineffective in the sense that we do not know any explicit characteristics of such family, see [7, Section 5.1].

The case when the associated polynomial \(\omega (x)\) is irreducible in \({\mathbb {F}}_p[x],\) was widely studied. In particular, from a more general result due to Katz [14, Theorem 4.1.1] it follows that if \(\omega (0)=1\) then

$$\begin{aligned} \left| \sum _{n \le \tau } {\mathbf {e}}_p\left( {s_n}\right) \right| \le p^{(r-1)/2}. \end{aligned}$$

Shparlinski [23] improved Korobov’s bound for all nonzero linear recurrence sequences with irreducible characteristic polynomial \(\omega (x) \) in \({\mathbb {F}}_p[x].\) From [23, Theorem 3.1] we get

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_p^*} \left| \sum _{n \le \tau }{\mathbf {e}}_p\left( {\xi s_n}\right) \right| \le \tau { p^{-\varepsilon /(r-1)}}+ r^{3/11}\tau ^{8/11}p^{(3r-1)/22}, \end{aligned}$$

for any given \(\varepsilon >0\) and with period \(\tau \) satisfying that

$$\begin{aligned} \max _{\begin{array}{c} d< r \\ d| r \end{array}} \gcd (\tau , p^d-1) < \tau p^{-\varepsilon }. \end{aligned}$$
(4)

In particular, if r is fixed then the upper bound is non trivial for \(\tau \ge p^{r/2 - 1/6 + \varepsilon }.\)

We already pointed out that the inequality (3) is nontrivial for \(\tau > p^{r/2 +\varepsilon },\) so the most important case occurs when \(\tau \le p^{r/2 + \varepsilon }\). If \(\tau \le p^{r/2 + \varepsilon },\) then condition (4) is needed to obtain a non trivial bound suggested by an example given in [23, Section 1]. In this particular example, the exponential sums of type

$$\begin{aligned} \left| \sum _{n=1}^{(p^m-1)/2}{\mathbf {e}}_p\left( {\text {Tr} (ag^{2n})}\right) \right| =\frac{(p^m-1)}{2}, \end{aligned}$$

are considered for certain a in \({\mathbb {F}}_{p^m}^*\) with g a generator of \({\mathbb {F}}_{p^m}^{*}\) and m be any even integer. It is worth noting that \(\{\text {Tr} (ag^{2n})\}\) is indeed a linear recurrence sequence of order m in \({\mathbb {F}}_p.\)

Moreover, we consider the general case when the associated polynomial \(\omega (x)\) is not necessarily irreducible, and deduce the following key result.

Theorem 1

Let p be a large prime number and \(\varepsilon> \varepsilon ' > 0.\) Suppose that \(\{ s_n\}\) is a nonzero linear recurrence sequence with positive order and period \(\tau \) in \({\mathbb {F}}_p\) such that its characteristic polynomial \(\omega (x)\) has distinct roots in its splitting field, and \((\omega (0), p)=1\). Set \(\omega (x)=\prod _{i}^{\nu }\omega _i(x)\) as a product of distinct irreducible polynomials in \({\mathbb {F}}_p[x],\) and for each i\(\alpha _i\) denotes a root of \(\omega _{i}(x).\) If all polynomials \(\omega _i(x)\) have the same degree, i.e. \(\deg \omega _i(x)=r>1,\) and the system \(\tau _i=\,\mathrm{ord}\,{\alpha _i},\) satisfies

$$\begin{aligned}&{(a) } \, \max _{\begin{array}{c} d< r \\ d| r \end{array}} \gcd (\tau _i, p^d-1)< \tau _i p^{-\varepsilon }, \quad \mathrm{for}\ \mathrm{any} \ 1 \le i \le \nu , \nonumber \\&{(b) } \, \gcd (\tau _i,\tau _j) < p^{\varepsilon '}, ~\mathrm{for}~\mathrm{some}~\mathrm{pair}~i \ne j~{along~with} ~{\mathbb {F}}_p(\alpha _i)\cong {\mathbb {F}}_p(\alpha _j), \end{aligned}$$
(5)

then there exists a \(\delta =\delta (\varepsilon ,\varepsilon ')>0\) such that

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_p^*} \left| \sum _{n \le \tau } {\mathbf {e}}_p\left( {\xi s_n}\right) \right| \le \tau { p^{-\delta }}. \end{aligned}$$
(6)

It turns out that, this extends [2, Corollary] due to Bourgain, where all of the irreducible factors have degree \(r=1,\) while Theorem 1 deals with the case \(r\ge 2.\)

This will be of immense use in what follows, roughly because the characteristic polynomial associated to \(\{a(p^n)\}\) have degree two.

Theorem 1 will be essential to establish Theorem 2 and Corollaries 12 and  17. Our approach, which relies on the sum-product phenomenon, provides an improvement over Theorem 3.1 of [23] for the same class of linear recurrence sequences, obtaining non trivial exponential sums in a larger range. To be more precise, if p(r) denotes the least prime divisor of r then any \(\tau >p^{r/p(r)+\varepsilon }\) satisfies

$$\begin{aligned} \tau p^{-\varepsilon } > p^{r/p(r)} \ge \max _{\begin{array}{c} d<r\\ d|r \end{array}} \gcd (\tau , p^{d}-1). \end{aligned}$$

In particular, our result works for any \(\tau >p^{r/p(r)+\varepsilon },\) while bound in [23] is nontrivial if \(\tau >p^{r/2-1/6+\varepsilon }.\) This is an improvement if \(p(r)>2,\) more precisely when r is odd.

1.2 Main results for exponential sum with modular forms

We now quickly discuss the main results obtained in this article. In the list, our first result is the following:

Theorem 2

Let f(z) be an eigenform with rational coefficients a(n). Let \({\mathcal {P}}\) be the set of primes p such that \(a(p^u)\ne 0\) for any \(u \in {\mathbb {N}}.\) Then the following is true.

  1. (i)

    The set of primes \({\mathcal {P}}\) satisfies that given \(p \in {\mathcal {P}},\) for any \(0< \varepsilon < 1/2\) there exists a \(\delta =\delta (\varepsilon )>0\) such that the following estimate

    $$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n) }\right) \right| \le \tau \ell ^{-\delta }, \end{aligned}$$
    (7)

    holds for \(\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell \le y,\) where the least period \(\tau \) of the linear recurrence sequence \(\{a(p^n)\} \,(\mathrm{mod}\,\ell )\) depends on both p and \(\ell \), and \(\pi (y)\) denotes the number of primes up to y which is asymptotically equivalent to \(\frac{y}{\log y}.\)

  2. (ii)

    For the exceptional set of primes \(p \notin {\mathcal {P}},\) let u be the least natural number such that \(a(p^u)=0.\) Then for any \( 0<\varepsilon < 1/2,\) there exists a \(\delta =\delta (\varepsilon )>0\) such that the following estimate

    $$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n) }\right) \right| =\frac{\tau }{u+1}+O(\tau \ell ^{-\delta }+u). \end{aligned}$$
    (8)

    holds for \(\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell \le y.\)

Roughly speaking, a newform of level N is a normalized eigenform which is not a cuspform of level \(N'\) for any proper divisor \(N'\) of N. For details and basics on modular forms, we refer the reader to [5]. A newform is said to have complex multiplication (CM) by a quadratic Dirichlet character \(\phi \) if \(f = f \otimes \phi \), where we define the twist as

$$\begin{aligned} f \otimes \phi = \sum _{n=1}^{\infty } a(n)\phi (n)q^n. \end{aligned}$$

In part (i) of Theorem 2, the condition \(a(p^u)\ne 0\) holds for almost all prime p provided that f is a newform without CM. This is a consequence of Sato-Tate conjecture and we shall discuss this again in the proof of Lemma 11. In particular, we have a non trivial estimate for the following exponential sum

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n) }\right) \right| \,. \end{aligned}$$
(9)

Let us recall that any general cusp form f can be uniquely written as \({\mathbb {C}}\)-linear combination of eigenforms. These eigenforms will be called as components of f. We then have the following result.

Theorem 3

Let f(z) be a cusp form which is not necessarily an eigenform, and can be written as a \({\mathbb {Q}}\)-linear combination of newforms with rational coefficients. Suppose that there are \(r_2\) many components with CM, then under the assumption of GST hypothesisFootnote 1 there exists a set of primes p with density at least \(2^{-r_2}\) such that for any \(0< \varepsilon < 1/2\) there exists a \(\delta =\delta (\varepsilon )>0\) for which the following estimate

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n) }\right) \right| \le \tau \ell ^{-\delta }, \end{aligned}$$
(10)

holds for \(c_f\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell \le y,\) where \(c_f>0\) is a constant.

In both of the above theorems, we took a fixed prime p and looked for primes \(\ell \) for which a non trivial estimate to (9) holds. However, these results are valid for almost all primes \(\ell ,\) and we do not know explicitly which of the primes are being excluded in this process. Thus, one may naturally ask, what if we now fix a prime \(\ell \) and find out for how many primes p the sum at (9) is non trivial. In this regard, we have the following results.

Theorem 4

Let f(z) be a newform of weight k,  without CM, and with integer Fourier coefficients. Consider the set \(\mathfrak {P}=\left\{ \ell ~\mathrm{prime} \mid (k-1,\ell -1)=1\right\} .\) Then, for any fixed \(\varepsilon >0\) and any large enough \(\ell \in \mathfrak {P},\) the set of primes p satisfying

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n) }\right) \right| \le \tau \ell ^{-\delta } \end{aligned}$$
(11)

have density at least \(1+O_{\varepsilon } \left( \frac{1}{\ell ^{1-3\varepsilon }}\right) ,\) where \(\delta =\delta (\varepsilon )\) is same as in Theorem 1.

Intuitively, this theorem can be regarded as the inverse of Theorem 2, and in this analogy, the following result as the inverse of Theorem 3. Just for the sake of simplicity we are assuming \((k-1,\ell -1)=1,\) which can be easily avoided and will be evident from the proof of the following theorem.

Theorem 5

If f(z) is a cuspform, and can be written as \({\mathbb {Q}}\) linear combination of r many newforms without CM and with integer coefficients, such that all of these components satisfies GST hypothesis. Then, for any fixed \(\varepsilon >0\) and large enough \(\ell ,\) the set of primes p satisfying

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n) }\right) \right| \le \tau \ell ^{-\delta } \end{aligned}$$
(12)

have density at least \(2^{-r}+O_{\varepsilon } \left( \frac{1}{\ell ^{1-2\varepsilon }}\right) ,\) where \(\delta =\delta (\varepsilon )\) is same as in Theorem 1.

1.3 Waring type problems over finite fields

Given a sequence \(\{x_n\}\), one of the classical questions are to decide whether \(\{x_n\}\) is an additive basis. More precisely, is there an absolute constant \(k\ge 1\) such that any residue class \(\lambda \) modulo p can be represented as

$$\begin{aligned} x_{n_1} + \cdots + x_{n_k} \equiv \lambda \,(\mathrm{mod}\,p), \end{aligned}$$

for infinitely many primes p?

In this article, we are concerned about the case when \(\{x_n\}\) is a linear recurrence sequence in \({\mathbb {F}}_p\). For a simple sequence \(2^n (\mathrm{mod}\,p),\) it follows combining a result of Erdős and Murty [6] and a result of Glibichuk [13] that for almost all primes p,  every residue class modulo p can be represented in the following form

$$\begin{aligned} 2^{n_1} + \cdots + 2^{n_8} (\mathrm{mod}\,p), \end{aligned}$$

for certain positive integers \(n_1, \cdots , n_8.\)

Note that \(2^n (\mathrm{mod}\,p)\) is a linear recurrence sequence of order 1. For higher order cases, one can ask about the classical case of Fibonacci sequences. The third author proved in [11, Theorem 2.2], that given a parameter \(N\rightarrow \infty ,\) for \(\pi (N)(1+o(1))\) primes \(p \le N,\) every residue class modulo p can be written as

$$\begin{aligned} F_{n_1}+\cdots + F_{n_{16}} \equiv \lambda \,(\mathrm{mod}\,p), \end{aligned}$$

provided that \(n_1, \ldots , n_{16} \le N^{1/2 + o(1)}.\) The method is based on the distribution properties of sparse sequences for almost all primes and particular identities of Lucas sequence. It does not seem easy to extend such ideas for general linear recurrence sequences. In this article, we prove that if \(\{s_n\}\) is a linear recurrence sequence in \({\mathbb {Z}},\) whose characteristic polynomial \(\omega (x) \in {\mathbb {Z}}[x]\) is monic, irreducible, and having prime degree, then there exists an absolute constant k such that every residue class \(\lambda (\mathrm{mod}\,p)\) can be represented as

$$\begin{aligned} s_{n_1}+\cdots + s_{n_k} \equiv \lambda \,(\mathrm{mod}\,p), \end{aligned}$$

for a set of primes p with positive density. We record this in Theorem 13 in Sect. 6.

2 Exponential sums with linear recurrence sequences

In this section, our main goal is to prove Theorem 1, which is one of our key tool in establishing several important results of this article. Recalling the example of Shparlinski in [23, Section 1], we already noticed in Sect. 1.1 that, condition (a) of Theorem 1 is needed if \(\omega (x)\) is irreducible in \({\mathbb {F}}_p[x].\) We shall discuss more about this condition later in Remark 1.

Now, we illustrate with an example that all of the \(\gcd (\tau _i,\tau _j)'s\) cannot be too large. In other words, we need condition (b) (or some other condition) to obtain a non trivial bound in Theorem 1. For example, let \(r=2\) and g be a generator of \({\mathbb {F}}_{\ell ^2}^*.\) Then, consider the sequence

$$\begin{aligned} s_n=\,\mathrm{Tr}\left( {g^{n(\ell ^2+1)/2} - g^n}\right) , \end{aligned}$$

with characteristic polynomial \((x-g)(x-g^{\ell })(x-g^{(\ell ^2+1)/2})(x-g^{\ell (\ell ^2+1)/2})\). Note that

$$\begin{aligned} \tau _2=\,\mathrm{ord}\,{g}=\ell ^2-1~\mathrm{and}~\tau _1 = \,\mathrm{ord}\,{g^{(\ell ^2+1)/2}} =\tfrac{\ell ^2-1}{\gcd (\ell ^2-1,(\ell ^2+1)/2)}. \end{aligned}$$

It is easy to see that \(\gcd (\ell ^2-1,(\ell ^2+1)/2)=1,\) so \(\gcd (\tau _1,\tau _2)= \ell ^2 - 1.\) On another hand we note that \(\gcd (\tau _1,\ell -1)=\ell -1.\) Then, one can show that

$$\begin{aligned} \sum _{n =1}^{\ell ^2 -1} {\mathbf {e}}_{\ell }\left( {s_n}\right)&= \sum _{n=1}^{\ell ^2 -1} {\mathbf {e}}_{\ell }\left( {\,\mathrm{Tr}\left( {g^{n(\ell ^2+1)/2} - g^n}\right) }\right) \\&= \sum _{n=1}^{(\ell ^2 -1)/2} {\mathbf {e}}_{\ell }\left( {\,\mathrm{Tr}\left( {g^{2n(\ell ^2+1)/2} - g^{2n}}\right) }\right) \\&\quad + \,\sum _{n=1}^{(\ell ^2 -1)/2} {\mathbf {e}}_{\ell }\left( {\,\mathrm{Tr}\left( {g^{(2n-1)(\ell ^2+1)/2} - g^{2n-1}}\right) }\right) \\&= \frac{\ell ^2-1}{2} + \sum _{n=1}^{(\ell ^2 -1)/2} {\mathbf {e}}_{\ell }\left( {\,\mathrm{Tr}\left( {-2g^{2n-1}}\right) }\right) = \frac{\ell ^2-1}{2} + \sum _{h \in H}{\mathbf {e}}_{\ell }\left( {\,\mathrm{Tr}\left( {-2gh}\right) }\right) , \end{aligned}$$

where \(H=\langle g^2 \rangle .\)

Let p be any prime and q be any power of p. Then, the classical theorem about additive sums for one-variable polynomial, due to A. Weil (see [17, Theorem 3.2]), states that, for a given polynomial \(f(x)\in {\mathbb {F}}_q[x]\) with degree d\(d < q,\) \(\gcd (d,q) = 1\) and a nontrivial additive character \(\psi \) in \({\mathbb {F}}_q,\) we have

$$\begin{aligned} \left| \sum _{x \in {\mathbb {F}}_q}\psi (f(x))\right| \le (d-1)\sqrt{q}. \end{aligned}$$
(13)

Consider

$$\begin{aligned} 1 + 2 \sum _{h \in H}{\mathbf {e}}_{\ell }\left( {\,\mathrm{Tr}\left( {-2gh}\right) }\right) = \sum _{x \in {\mathbb {F}}_{\ell ^2}}\psi (x^2), \end{aligned}$$

where \(\psi (\omega )= {\mathbf {e}}_{\ell }\left( {\,\mathrm{Tr}\left( {-2g \omega }\right) }\right) \) is a nonzero additive character of \({\mathbb {F}}_{\ell ^2}.\) Applying (13) with \(f(x) = x^2\), it follows that

$$\begin{aligned} \left| \sum _{h\in H} {\mathbf {e}}_{\ell }\left( {\,\mathrm{Tr}\left( {-2gh}\right) }\right) \right| \le \left| \sum _{x \in {\mathbb {F}}_{\ell ^2} } \psi ({ x^2})\right| \le \ell . \end{aligned}$$

Therefore, the linear recurrence sequence \(\{s_n\}\) satisfies

$$\begin{aligned} \sum _{n =1}^{\ell ^2 -1} {\mathbf {e}}_{\ell }\left( {s_n}\right) = \frac{\ell ^2-1}{2} + O(\ell ). \end{aligned}$$

We now need to discuss some necessary background. Let K be a finite field of characteristic p and F be an extension of K with \([F:K]=r.\) The trace function \(\,\mathrm{Tr}_{F/K} : F \rightarrow K\) is defined by

$$\begin{aligned} \,\mathrm{Tr}_{F/K}(z)= z + z^p + \cdots +z^{p^{r-1}}, \qquad z\in F. \end{aligned}$$

The following properties of \(\,\mathrm{Tr}_{F/K}(z)\) are well known.

$$\begin{aligned} \,\mathrm{Tr}_{F/K}(az + w)&= a\,\mathrm{Tr}_{F/K}(z) + \,\mathrm{Tr}_{F/K}(w), \quad \mathrm{for}\ \mathrm{all}\ a \in K, \, z,w\in F. \end{aligned}$$
(14)
$$\begin{aligned} \,\mathrm{Tr}_{F/K}(a)&=ra, \quad \mathrm{for}\ \mathrm{any} \quad a \in K. \end{aligned}$$
(15)
$$\begin{aligned} \,\mathrm{Tr}_{F/K}(z^p)&= \,\mathrm{Tr}_{F/K}(z), \quad \mathrm{for}\ \mathrm{any} \quad z \in F. \end{aligned}$$
(16)

Throughout this section, \(F={\mathbb {F}}_q\), \(K={\mathbb {F}}_p\) with \(q=p^r\) and we will simply write \(\,\mathrm{Tr}\left( {z}\right) \) instead \(\,\mathrm{Tr}_{F/K}(z)\).

Let \(\{s_n\}\) be a linear recurrence sequence of order \(r\ge 1\) in \({\mathbb {F}}_p\) with characteristic polynomial \(\omega (x)\) in \({\mathbb {F}}_p[x].\) It is well known that nth-term can be written in terms of the roots of the characteristic polynomial, see Theorem 6.21 in [18]. Therefore, if the roots \(\alpha _0, \ldots , \alpha _{r-1}\) of \(\omega (x)\) are all distinct in its splitting field, then

$$\begin{aligned} s_n= \sum _{i=0}^{r-1} \beta _i \alpha _i^n, \quad \mathrm{for}\ \, n=0,1,2,\ldots , \end{aligned}$$
(17)

where \(\beta _0,\ldots ,\beta _{r-1}\) are uniquely determined by initial values \(s_0, \ldots , s_{r-1},\) and belong to the splitting field of \(\omega (x)\) over \({\mathbb {F}}_p.\) If the characteristic polynomial \(\omega (x)\) is irreducible and \(\alpha \) is a root, then its r distinct conjugates are

$$\begin{aligned} \alpha , \alpha ^{p}, \ldots , \alpha ^{p^{r-2}}, \alpha ^{p^{r-1}}. \end{aligned}$$

Hence, the coefficients \(s_n\) are given by

$$\begin{aligned} s_n=\sum _{i=0}^{r-1}\beta _i \alpha ^{p^in}, \qquad n=0,1,2,3,\ldots \, . \end{aligned}$$

One of our main tools is the bound for Gauss sum in finite fields given by Bourgain and Chang [3, Theorem 2]. This will be required to prove Theorem 1. Assume that for a given \(\alpha \in {\mathbb {F}}_{q}\) and \(\varepsilon >0,\)

such that \(\,\mathrm{ord}\,{\alpha }=t\) satisfies

$$\begin{aligned} t > p^{\varepsilon } \quad \mathrm{and} \quad \max _{\begin{array}{c} 1\le d< r \\ d |r \end{array}} \gcd (t, p^d - 1) < t p^{-\varepsilon }. \end{aligned}$$
(18)

Then, there exists a \(\delta =\delta (\varepsilon )>0\) such that for any nontrivial additive character \(\psi \) of \({\mathbb {F}}_q,\) we have

$$\begin{aligned} \left| \sum _{n \le t} \psi (\alpha ^n) \right| \le t p^{-\delta }. \end{aligned}$$

Note that the second assumption in (18) implies the first one whenever \(r\ge 2\).

2.1 Proof of Theorem 1

We proceed by induction over \(\nu .\) Before that, following properties (14) and (15) of trace function we write

$$\begin{aligned} s_{n}&=\,\mathrm{Tr}\left( {r^{-1}s_{n}}\right) =r^{-1}\,\mathrm{Tr}\left( {\sum _{i=1}^{\nu } (\beta _{i,0}\alpha _i^n + \cdots + \beta _{i,r-1}\alpha _i^{p^{r-1}n})}\right) \\&=r^{-1} \sum _{i=1}^{\nu } \sum _{j=0}^{r-1} \,\mathrm{Tr}\left( {\beta _{i,j} \alpha _i^{p^{j}n}}\right) . \end{aligned}$$

By the assumption, \([{\mathbb {F}}_p(\alpha _i):{\mathbb {F}}_p]=r\) for any \(1\le i\le \nu .\) In other words, any such \(\alpha _i\) is in \({\mathbb {F}}_{p^r}.\) We then have, \(r=[{\mathbb {F}}_p(\alpha _1, \ldots , \alpha _{\nu }):{\mathbb {F}}_p]\) and \(z^{p^r}=z\) for any \(z \in {\mathbb {F}}_p(\alpha _1, \ldots , \alpha _{\nu }).\) In addition, from (16) it follows that, \(\,\mathrm{Tr}\left( {z^p}\right) =\,\mathrm{Tr}\left( {z}\right) \) for any \(z\in {\mathbb {F}}_p(\alpha _1, \ldots , \alpha _{\nu }).\) Then, for each pair (ij),  raising each argument \(\beta _{i,j}\alpha _i^{p^jn}\) to the power \(p^{r-j}\)

$$\begin{aligned} \,\mathrm{Tr}\left( {\beta _{i,j}\alpha _i^{p^jn}}\right) =\,\mathrm{Tr}\left( {\beta _{i,j}^{p^{r-j}} \alpha _i^{p^jn \cdot p^{r-j}}}\right) = \,\mathrm{Tr}\left( {\beta _{i,j}^{p^{r-j}} \alpha _i^{p^rn}}\right) = \,\mathrm{Tr}\left( {\beta _{i,j}^{p^{r-j}}\alpha _i^{n}}\right) . \end{aligned}$$

This implies that

$$\begin{aligned} s_{n}&= r^{-1} \sum _{i=1}^{\nu } \sum _{j=0}^{r-1} \,\mathrm{Tr}\left( { \beta _{i,j}^{p^{r-j}} \alpha _i^{n}}\right) = r^{-1} \sum _{i=1}^{\nu } \,\mathrm{Tr}\left( { \left( \sum _{j=0}^{r-1} \beta _{i,j}^{p^{r-i}}\right) \alpha _i^{n}}\right) \nonumber \\&= \,\mathrm{Tr}\left( {\gamma _1 \alpha _1^n }\right) + \cdots + \,\mathrm{Tr}\left( {\gamma _{\nu } \alpha _{\nu }^n}\right) , \end{aligned}$$
(19)

where \(\gamma _i = r^{-1}\sum _{j=0}^{r-1} \beta _{i,j}^{p^{r-i}},\) for each \(1 \le i \le \nu .\)

The case \(\nu = 1\) follows from Bourgain and Chang [3, Theorem 2]. We shall now proceed inductively, and \(\nu =2\) will be the base case. We start by denoting \(h=\mathrm{gcd}(\tau _1,\tau _2).\) It is clear that \(\mathrm{lcm}(\tau _1, \tau _2)=\tau _1 \tau _2/h\) is a period of \(s_n,\) then

$$\begin{aligned} \left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\xi s_n}\right) \right| =\frac{\tau }{\tau _1 \tau _2/h}\left| \sum _{n\le \tfrac{\tau _1 \tau _2}{h}} {\mathbf {e}}_p\left( {\xi s_n}\right) \right| . \end{aligned}$$

Hence, it is enough to prove that

$$\begin{aligned} \left| \sum _{n\le \tfrac{\tau _1 \tau _2}{h}} {\mathbf {e}}_p\left( {\xi s_n}\right) \right| \le \frac{\tau _1 \tau _2}{h} p^{-\delta }, \quad \mathrm{with}\ \, (\xi ,p)=1, \end{aligned}$$

for some \(\delta = \delta (\varepsilon )>0.\) Dividing the range of the sum \(n \le \tau _1 \tau _2/ h\) into the form \(n = m h + u_0 \) with \(m\le \tau _1\tau _2 / h^2\) and \(0\le u_0 \le h-1,\) we have

$$\begin{aligned} \left| \sum _{n\le \tfrac{\tau _1 \tau _2}{h}} {\mathbf {e}}_p\left( {\xi s_n}\right) \right|&=\left| \sum _{u_0=0}^{h-1}\sum _{n\le \tfrac{\tau _1 \tau _2}{h^2}} {\mathbf {e}}_p\left( {\xi s_{nh + u_0}}\right) \right| \le \sum _{u_0=0}^{h-1} \left| \sum _{n\le \tfrac{\tau _1 \tau _2}{h^2}} {\mathbf {e}}_p\left( {\xi s_{nh + u_0}}\right) \right| \nonumber \\&\le h \times \max _{0 \le u_0 \le h-1} \left| \sum _{n\le \tau _1 \tau _2/h^2}{\mathbf {e}}_p\left( {\xi s_{nh + u_0}}\right) \right| . \end{aligned}$$
(20)

Let \((n_1,n_2)\) be a tuple with \(n_i\le \frac{\tau _i}{h}.\) Since \(\gcd (\tfrac{\tau _1}{h},\tfrac{\tau _2}{h})=1\), by Chinese remainder theorem, there exist integers \(m_1,m_2\) with \(\gcd (m_1, \tfrac{\tau _1}{h})= \gcd (m_2,\tfrac{\tau _2}{h})=1, \) such that

$$\begin{aligned} \left| \left\{ n \,\left( \mathrm{mod}\,\tfrac{\tau _1 \tau _2}{h^2}\right) \,:\, 1\le n \le \frac{\tau _1 \tau _2}{h^2} \right\} \right| =\left| \left\{ n_1 m_1 \tfrac{\tau _2}{h} +n_{2} m_{2} \tfrac{\tau _1}{h} \,\left( \mathrm{mod}\,\tfrac{\tau _1 \tau _2}{ h^2}\right) :\, 1\le n_i \le \frac{\tau _i}{h} \right\} \right| .\nonumber \\ \end{aligned}$$
(21)

Moreover, the pair \((m_1, m_2 )\) has the following property: given \((n_1, n_{2}),\) with \(1\le n_i\le \tau _i/h,\) then \(n = n_1 m_1 \tfrac{\tau _2}{h} +n_{2} m_{2} \tfrac{\tau _1}{h}\) satisfies

$$\begin{aligned} n \equiv n_1 \,\left( \mathrm{mod}\,\tfrac{\tau _1}{h}\right) \; \mathrm{and}\ \, n \equiv n_2 \,\left( \mathrm{mod} \,\tfrac{\tau _2}{h}\right) , \end{aligned}$$

and n is unique modulo \(\tfrac{\tau _1\tau _2}{h^2}.\) Since \(\tfrac{\tau _1}{h}= \,\mathrm{ord}\,{\alpha _1^h}\) and \(\tfrac{\tau _2}{h} =\,\mathrm{ord}\,{\alpha _2^h}\), then

$$\begin{aligned} \alpha _i^{hn} = \alpha _i^{h\left( n_1 m_1 \tfrac{\tau _2}{h} +n_{2} m_{2} \tfrac{\tau _{1}}{h}\right) } = \alpha _i^{hn_i}, \quad 1 \le i \le 2. \end{aligned}$$
(22)

Combining (21) and (22), we have

$$\begin{aligned} \left| \sum _{n\le \tfrac{\tau _1 \tau _2}{h^2}}{\mathbf {e}}_p\left( {\xi s_{nh+u_0}}\right) \right|&= \left| \sum _{n_1\le \tfrac{\tau _1 }{h}} {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {\xi \gamma _1 \alpha _1^{n_1h + u_0} }\right) }\right) \right| \nonumber \\&\quad \times \,\left| \sum _{n_2\le \tfrac{ \tau _2}{h}} {\mathbf {e}}_p\left( { \,\mathrm{Tr}\left( {\xi \gamma _{2} \alpha _{2}^{n_{2}h+u_0}}\right) }\right) \right| \nonumber \\&=\left| \sum _{n_1\le \tfrac{\tau _1 }{h}} {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {\gamma '_1 \alpha _1^{n_1h} }\right) }\right) \right| \times \left| \sum _{n_2\le \tfrac{ \tau _2}{h}} {\mathbf {e}}_p\left( { \,\mathrm{Tr}\left( {\gamma '_{2} \alpha _{2}^{n_{2}h}}\right) }\right) \right| , \end{aligned}$$
(23)

with \(\gamma '_1=\xi \gamma _1 \alpha _1^{u_0}, \gamma '_2 =\xi \gamma _2\alpha _2^{u_0} \) in \({\mathbb {F}}_p(\alpha _1, \alpha _2).\) Since \(\{s_n\}\) is a nonzero sequence, therefore \(\gamma '_i \ne 0,\) at least for some \(1\le i \le 2.\) First, let us assume that \(\gamma '_1, \gamma '_2 \ne 0.\)

Each \({\mathbf {e}}_p\left( { \,\mathrm{Tr}\left( {\xi \gamma '_{i} z}\right) }\right) \) corresponds to a nontrivial additive character, say \(\psi _i(z),\) in \({\mathbb {F}}_p(\alpha _i)={\mathbb {F}}_{p^r}.\) In order to satisfy condition (18), we first recall assumptions \(h < p^{\varepsilon '},\) \(\varepsilon> \varepsilon '>0\) and \(\max _{\begin{array}{c} d< r \\ d | r \end{array}} \gcd (\tau _i, p^d-1) < \tau _i p^{-\varepsilon }\) for some \(i \in \{1,2\}.\) Without loss of generality, let us assume that \(i=1.\) Then, for any d|r with \(1\le d < r\), we have

$$\begin{aligned} \gcd \left( \tfrac{\tau _1}{h} , p^d - 1 \right) \le \gcd (\tau _1, p^d -1)< \tau _1 p^{-\varepsilon } <\frac{\tau _1}{h}p^{-(\varepsilon -\varepsilon ')}. \end{aligned}$$

Therefore, by Bourgain and Chang [3, Theorem 2] it follows that

$$\begin{aligned} \left| \sum _{n_1 \le \tau _1/h}{\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {\gamma '_1 \alpha _1^{n_1h} }\right) }\right) \right| =\left| \sum _{n_1 \le \tau _1/h}\psi _1({ \alpha _1^{n_1h} }) \right| \le \frac{\tau _1}{h}p^{-\delta }. \end{aligned}$$

On the other hand, bounding trivially we have

$$\begin{aligned} \left| \sum _{n_2 \le \tau _2/h}{\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {\gamma '_2 \alpha _2^{n_2h} }\right) }\right) \right| =\left| \sum _{n_2 \le \tau _2/h}\psi _2({ \alpha _2^{n_2h} }) \right| \le \frac{\tau _2}{h}. \end{aligned}$$

Thus, combining above equations with (20) and (23) we get

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_p^*} \left| \sum _{n \le \frac{\tau _1\tau _2}{h}} {\mathbf {e}}_p\left( {\xi s_{n}}\right) \right| \le h \times \frac{\tau _1 \tau _2}{h^2}p^{-\delta } =\frac{\tau _1 \tau _2}{h}p^{-\delta }. \end{aligned}$$

Now, let us assume that one of the \(\lambda _i'=0,\) say for \(i=2\). Arguing exactly as few lines above, it follows from assumption (a) that

$$\begin{aligned} \left| \sum _{n_1 \le \tau _1/h}{\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {\gamma '_1 \alpha _1^{n_1h}}\right) }\right) \right| \le \frac{\tau _1}{h}p^{-\delta }, \quad \mathrm{and} \quad \left| \sum _{n_2 \le \tau _2/h} {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {\gamma '_2 \alpha _2^{n_2h} }\right) }\right) \right| = \frac{\tau _2}{h}. \end{aligned}$$

Hence, the desired bound follows. This conclude the case \(\nu =2.\)

Now, we proceed by induction over \(\nu ,\) and assume Theorem 1 to be true up to \(\nu -1.\) We follow the idea due to Garaev [9, Section 4.4]. Considering (19) and periodicity, for any \(t\ge 1\) we get

$$\begin{aligned} \tau \left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\xi s_n}\right) \right| ^{2t}&= \sum _{m\le \tau }\left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\xi s_{m+n}}\right) \right| ^{2t} \\&= \sum _{m\le \tau }\left| \sum _{n \le \tau } {\mathbf {e}}_p\left( {\xi (\,\mathrm{Tr}\left( {\gamma _1 \alpha _1^{m+n} }\right) + \cdots + \,\mathrm{Tr}\left( {\gamma _{\nu } \alpha _{\nu }^{m+n}}\right) )}\right) \right| ^{2t} \\&\le \sum _{n_1\le \tau } \cdots \sum _{n_{2t}\le \tau } \left| \sum _{m\le \tau } {\mathbf {e}}_p\left( {\xi \sum _{i=1}^{\nu } \,\mathrm{Tr}\left( {\gamma _i\alpha _i^{m}\left( \alpha _i^{n_1} + \cdots - \alpha _i^{n_{2t}}\right) }\right) }\right) \right| . \end{aligned}$$

Raising to the power 2t,  and applying Cauchy–Schwarz, we have

$$\begin{aligned} \tau ^{2t}\left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\xi s_n}\right) \right| ^{4t^2}&\le {\tau ^{2t(2t-1)}}\\&\quad \times \,\sum _{n_1\le \tau } \cdots \sum _{n_{2t}\le \tau }\left| \sum _{m\le \tau } {\mathbf {e}}_p\left( {\xi \sum _{i=1}^{\nu } \,\mathrm{Tr}\left( {\gamma _i\alpha _i^{m} \left( \alpha _i^{n_1}+ \cdots - \alpha _i^{n_{2t}}\right) }\right) }\right) \right| ^{2t}. \end{aligned}$$

Given \((\lambda _1 ,\cdots , \lambda _{\nu }) \in {\mathbb {F}}_q^{\nu },\) let \(J_t(\lambda _1 ,\cdots , \lambda _{\nu })\) denote the number of solutions of the system

$$\begin{aligned} \left\{ \begin{array}{ccc} \alpha _1^{n_1} + \cdots + \alpha _{1}^{n_t} &{} = &{} \alpha _{1}^{n_{t+1}} + \cdots + \alpha _1^{n_{2t}} + \lambda _1 \\ \vdots \qquad \vdots &{} &{} \vdots \qquad \vdots \qquad \vdots \\ \alpha _{\nu }^{n_1}+ \cdots + \alpha _{\nu }^{n_t} &{}=&{} \alpha _{\nu }^{n_{t+1}} + \cdots +\alpha _{\nu }^{n_{2t}} + \lambda _{\nu } \end{array}\right. \end{aligned}$$

with \(1 \le n_1, \cdots , n_{2t} \le \tau .\) Therefore,

$$\begin{aligned} \left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\xi s_n}\right) \right| ^{4t^2}&\le \tau ^{4t^2-4t} \sum _{\lambda _1 \in {\mathbb {F}}_q} \cdots \sum _{\lambda _{\nu } \in {\mathbb {F}}_q} J_t(\lambda _1 ,\cdots , \lambda _{\nu })\nonumber \\&\quad \times \,\left| \sum _{m\le \tau } {\mathbf {e}}_p\left( { \xi \sum _{i=1}^{\nu } \,\mathrm{Tr}\left( {\gamma _i \lambda _i \alpha _i^{m}}\right) }\right) \right| ^{2t}. \end{aligned}$$
(24)

Note that writing \(J_{\nu }(\lambda _1 \cdots , \lambda _{\nu })\) in terms of character sums, it follows that

$$\begin{aligned} J_{t}(\lambda _1 \cdots , \lambda _{\nu })&= \frac{1}{q^{\nu }}\sum _{x_1 \in {{\mathbb {F}}}_{q} } \cdots \sum _{x_{\nu } \in {{\mathbb {F}}}_{q}} \left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {x_1 \alpha _1^n}\right) }\right) \cdots {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {x_{\nu } \alpha _{\nu }^n}\right) }\right) \right| ^{2t} \\&\quad \times {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {x_1 \lambda _1}\right) }\right) \cdots {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {x_{\nu } \alpha _{\nu }^n}\right) }\right) \\&\le \frac{1}{q^{\nu }}\sum _{x_1 \in {{\mathbb {F}}}_{q} } \cdots \sum _{x_{\nu } \in {{\mathbb {F}}}_{q}} \left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {x_1 \alpha _1^n}\right) }\right) \cdots {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {x_{\nu } \alpha _{\nu }^n}\right) }\right) \right| ^{2t} \\&\le J_{t}(0, \ldots , 0) =:J_{t,\nu }. \end{aligned}$$

In particular, we note that \(J_{t,\nu } \le J_{t,\nu -1}.\) From (24), it follows that

$$\begin{aligned}&\left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\xi s_n}\right) \right| ^{4t^2}\\&\quad \le \tau ^{4t^2-4t} J_{t,\nu } \sum _{m_1\le \tau } \cdots \sum _{m_{2t}\le \tau } \sum _{\lambda _1 \in {\mathbb {F}}_q} \cdots \sum _{\lambda _{\nu } \in {\mathbb {F}}_q} {\mathbf {e}}_p\left( {\sum _{i=1}^{\nu } \,\mathrm{Tr}\left( {\xi \gamma _i\lambda _i (\alpha _i^{m_1} + \cdots -\alpha _i^{m_{2t}})}\right) }\right) \,. \end{aligned}$$

Note that \(a \gamma \lambda ,\) with \(a\gamma \ne 0,\) runs over \(\lambda \in {\mathbb {F}}_q\), then \({\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {a \theta \lambda z}\right) }\right) \) runs through all additive characters \(\psi \) in \(\widehat{{\mathbb {F}}}_{q},\) evaluated at z. Then, the above expression can be written as

$$\begin{aligned} \left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\xi s_n}\right) \right| ^{4t^2}&\le \tau ^{4t^2-4t} J_{t,\nu } \sum _{m_1\le \tau } \cdots \sum _{m_{2t}\le \tau } \prod _{i=1}^{\nu } \left( \sum _{x \in {{\mathbb {F}}}_q} {\mathbf {e}}_p\left( {x(\alpha _i^{m_1} +\cdots - \alpha _i^{m_{2t}})}\right) \right) \nonumber \\&\le \tau ^{4t^2-4t} q^{\nu } J^2_{t,\nu } \le \tau ^{4t^2-4t} q^{\nu } J^2_{t,\nu -1}. \end{aligned}$$
(25)

We now require an estimate for \(J_{t,\nu -1},\) and write

$$\begin{aligned} J_{t,\nu -1}&= \frac{1}{q^{\nu -1}}\sum _{\lambda _1 \in {\mathbb {F}}_q} \cdots \sum _{\lambda _{\nu -1} \in {\mathbb {F}}_q } \left| \sum _{m \le \tau } {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {\lambda _1 \alpha _1^m +\cdots + \lambda _{\nu -1}\alpha _{\nu -1}^m}\right) }\right) \right| ^{2t} \nonumber \\&= \frac{\tau ^{2t}}{q^{\nu -1}} +O\left( \left( \max _{\begin{array}{c} (\lambda _1, \ldots , \lambda _{\nu -1}) \in {\mathbb {F}}_q^{\nu -1} \\ (\lambda _1, \ldots , \lambda _{\nu -1}) \ne 0 \end{array}} \left| \sum _{m\le \tau } {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {\lambda _1 \alpha _1^m +\cdots + \lambda _{\nu -1}\alpha _{\nu -1}^m}\right) }\right) \right| \right) ^{2t}\right) . \end{aligned}$$
(26)

Finally, we note that \(s'_m=\,\mathrm{Tr}\left( {\lambda _1 \alpha _1^m + \cdots +\lambda _{\nu -1}\alpha _{\nu -1}^m}\right) \) defines a linear recurrence sequence with period \(\tau '\) dividing \(\tau ,\) which in particular satisfies induction hypothesis. Therefore

$$\begin{aligned} \left| \sum _{m\le \tau } {\mathbf {e}}_p\left( {\,\mathrm{Tr}\left( {\lambda _1 \alpha _1^m + \cdots + \lambda _{\nu -1}\alpha _{\nu -1}^m}\right) }\right) \right| \le \tau p^{-\delta '}, \end{aligned}$$

for some \(\delta '=\delta '(\varepsilon )>0.\) Now, taking \(t>d(\nu -1)/ 2\delta '\) (where \(d=[{\mathbb {F}}_q:{\mathbb {F}}_p]\)) and combining with (26), we get

$$\begin{aligned} J_{t,\nu -1} \ll \frac{\tau ^{2t}}{q^{\nu -1}}. \end{aligned}$$

We conclude the proof combining the above estimate with (25) to getFootnote 2

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_p^*}\left| \sum _{n\le \tau } {\mathbf {e}}_p\left( {\xi s_n}\right) \right| \le \tau p^{-\delta }, \quad \mathrm{with} \quad \delta =\tfrac{d(\nu -2)}{4t^2}. \end{aligned}$$

The following is an immediate corollary of this theorem which will be quite handy in establishing several results in Sects. 3 and 6.

Corollary 6

Suppose that \(\{ s_n\}\) is a nonzero linear recurrence sequence of order \(r\ge 2\) such that its characteristic polynomial \(\omega (x)\) is irreducible in \({\mathbb {F}}_p[x].\) If its period \(\tau \) satisfies

$$\begin{aligned} \max _{\begin{array}{c} d< r \\ d| r \end{array}} \gcd ({\tau }, p^d-1) < {\tau } \, p^{-\varepsilon }, \end{aligned}$$

then there exists a \(\delta =\delta (\varepsilon )>0\) such that

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_p^*} \left| \sum _{n \le \tau }{\mathbf {e}}_p\left( {\xi s_n}\right) \right| \le \tau { p^{-\delta }}. \end{aligned}$$

Remark 1

It is possible to relax the condition (a) by assuming that

$$\begin{aligned} \max _{\begin{array}{c} d< r \\ d| r \end{array}} \gcd (\tau _i, p^d-1) < \tau _i p^{-\varepsilon } \end{aligned}$$

holds for some \(1\le i\le \nu \) for which \(\lambda _i'\ne 0,\) where \(\lambda _i'\) is defined in the proof of Theorem 1. Also, note that \(\lambda _i'=0\) if and only if \(\lambda _i=0.\)

Since \(\{s_n\}\) is a nonzero linear recurrence sequence, there exists some \(1\le i\le \nu \) for which \(\lambda _i\ne 0.\) We discussed in Sect. 1.1 that why (a) (or some other condition) is needed to prove the irreducible case of Theorem 2. Now, for the reducible case, some of the \(\lambda _i\) could be 0. For the worst case scenario, let us assume that only one of them is nonzero, say for \(i=1.\) Then, it follows from (19) that, we are back to considering the irreducible case and then we need the condition (a) for \(i=1.\) In particular, we need (a) (or some other condition) for each irreducible component of the underlying \(\omega (x)\).

3 Exponential sums for modular forms

In this section, we study the effect of linear recurrence sequence and Theorem 1 in the behaviour of the exponential sums associated with certain Fourier coefficients of modular forms. As a consequence, we obtain interesting results which have been summarized earlier in the form of Theorems 2 and 3.

3.1 Order of the roots of the characteristic polynomial

In the case of normalized eigenforms, the sequence \(\{a(p^n)\}\) defines a linear recurrence sequence of order two when \(p\not \mid N,\) otherwise it is of order one. This is one of the tools for Theorem 2. However, we do not need to assume that the form is normalized because the normalizing factor is in \({\mathbb {Q}},\) and we can realize that to be an element of \({\mathbb {F}}_{\ell }^{*}\) for any large enough prime \(\ell .\) Before going into the proof of this theorem, we develop a tool which will be quite useful throughout. We state it in the form of following lemma.

Lemma 7

Let \(\omega (x)=x^2 + ax +b \in {\mathbb {Z}}[x]\) be a quadratic polynomial with \(b \ne 0\) and let \(\alpha , \beta \) be its roots such that none of the \(\alpha , \beta \) or \(\alpha \beta ^{-1}\) is a root of unity. For any prime \(\ell ,\) let \(\alpha _{\ell },\) \(\beta _{\ell }\) be its roots in the splitting field of \(\omega (x)\) over \({\mathbb {F}}_{\ell }.\)

Then, given \(0< \varepsilon < 1/2,\) for \(\pi (y) +O(y^{2\varepsilon })\) many primes \(\ell \le y,\) we have

$$\begin{aligned} \,\mathrm{ord}\,{\alpha _{\ell }}> \ell ^{\varepsilon }, \qquad \,\mathrm{ord}\,{\beta _{\ell }}> \ell ^{\varepsilon } \quad \mathrm{and} \quad \,\mathrm{ord}\,{(\alpha _{\ell } \beta _{\ell }^{-1}}) >\ell ^{\varepsilon }. \end{aligned}$$

Proof

Given a large positive parameter T,  we begin by considering the polynomial

$$\begin{aligned} G_T(x)= \prod _{t \le T} (x^t - 1 )(x^{2t}-b^t) \in {\mathbb {Z}}[x]. \end{aligned}$$

It is clear that \(\omega (x) \,(\mathrm{mod}\,\ell )\) has distinct roots for all but finitely many primes \(\ell ,\) since \(a^2 - 4b\ne 0.\) For any such prime \(\ell \), let \(\alpha _{\ell }\) and \(\beta _{\ell }\) be the distinct roots in its splitting field. We now consider the resultant \(\mathrm{Res}(\omega (x),G_T(x))\), and note that

$$\begin{aligned} \mathrm{Res}(\omega (x),G_T(x)) \,(\mathrm{mod}\,\ell ) =\prod _{1\le i \le 3T}(\alpha _{\ell } -\mu _i)(\beta _{\ell } -\mu _i), \end{aligned}$$

where each \(\mu _i\) is a root of \(G_T(x)\) in its splitting field over \({\mathbb {F}}_{\ell }.\)

In particular, \(\mathrm{Res}(\omega (x),G_T(x))\equiv 0 \,(\mathrm{mod}\,\ell )\) if and only if \(\omega (x) \,(\mathrm{mod}\,\ell )\) and \(G_T(x) (\mathrm{mod}\,\ell )\) have common roots in some finite extension of \({\mathbb {F}}_{\ell }.\) Additionally, since \(\alpha _{\ell } \beta _{\ell } = b,\) it follows that \(\,\mathrm{ord}\,{(\alpha _{\ell }\beta _{\ell }^{-1})} \le T\) if and only if \(\alpha _{\ell }^{2t} - b^t =0\) (or \(\beta _{\ell }^{2t} - b^t =0\)), for some \(t \le T.\) Therefore, \(\alpha _{\ell }\) (or \(\beta _{\ell }\)) is a common root of \(\omega (x) \,(\mathrm{mod}\,\ell )\) and \(G_{T}(x) \,(\mathrm{mod}\,\ell )\) if \(\,\mathrm{ord}\,{\alpha _{\ell }}\) or \(\,\mathrm{ord}\,{(\alpha _{\ell }\beta _{\ell }^{-1})}\) (or \(\,\mathrm{ord}\,{\beta _{\ell }}\) or \(\,\mathrm{ord}\,{(\alpha _{\ell }\beta _{\ell }^{-1})}\)) is less than T. Now, the Sylvester matrix of \(\omega (x)\) and \(G_T(x)\) is a square matrix of order \(2 + \deg (G_T(x))\ll T^2,\) and entries bounded by an absolute constant M (which depends on ab and not on \(\ell \) or the parameter T). Then, by Hadamard’s inequality, the determinant

$$\begin{aligned} \mathrm{Res}(\omega (x),G_T(x))\le T^{T^2} \times M^{T^2} \ll M^{2T^2 \log T}. \end{aligned}$$

Note that \(\text {Res}(\omega (x),G_T(x))\) is zero if and only if \(\alpha ^t=1, \beta ^{t}=1\) or \((\alpha \beta ^{-1})^t=1\) for some \(t\le T,\) which, following our assumption, can not happen. In particular, the resultant has at most \(O\left( T^2\right) \) many distinct prime divisors. This shows that

$$\begin{aligned} |\{\ell ~\mathrm{prime} \mid \,\mathrm{ord}\,{\alpha _{\ell }} \le T \quad \mathrm{or}\ \, \,\mathrm{ord}\,{\beta _{\ell }} \le T \quad \mathrm{or}\ \, \,\mathrm{ord}\,{\alpha _{\ell } \beta _{\ell }}^{-1}\le T\}|=O(T^2). \end{aligned}$$

Choosing \(T=y^{\varepsilon }\), the number of primes \(\ell \le y\) such that

$$\begin{aligned} \,\mathrm{ord}\,{\alpha _{\ell }} \le \ell ^{\varepsilon } \quad \mathrm{or} \quad \,\mathrm{ord}\,{\beta _{\ell }} \le \ell ^{\varepsilon } \quad \mathrm{or} \quad \,\mathrm{ord}\,{(\alpha _{\ell } \beta _{\ell }^{-1}}) \le \ell ^{\varepsilon } \end{aligned}$$

is \(O\left( y^{2\varepsilon }\right) \). \(\square \)

Let us now proceed to prove the main result of this section.

3.2 Proof of Theorem 2

If \(p\mid N,\) then \(a(p^n)=a(p)^n\) for any n. We only need to consider

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau }{\mathbf {e}}_{\ell }\left( {\xi a(p)^n }\right) \right| . \end{aligned}$$
(27)

If \(p\notin {\mathcal {P}},\) then there exists u such that \(a(p^u)=0.\) Since \(p\mid N,\) we have \(a(p)=0.\) In this case, the sum is O(1) because we have \(\tau =1.\)

On the other hand, if \(p\in {\mathcal {P}},\) then for any prime \(\ell \) large enough \(\tau \) is simply the order of \(a(p)\,(\mathrm{mod}\,\ell )\) in \({\mathbb {F}}_{\ell }^{*}.\) Due to Lemma 7, we may assume that \(\tau >p^{\varepsilon }\) holds for \(\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell <y.\) Hence, this case is settled down by [4, Theorem 6].

Let us now consider the case \(p\not \mid N\). The characteristic polynomial of (1) is

$$\begin{aligned} \omega (x)=x^2- a(p)x + p^{k-1}, \end{aligned}$$
(28)

and has discriminant \(a^2(p)-4p^{k-1}.\) We note that in our case the discriminant does not vanish, otherwise \(|a(p)|=2p^{(k-1)/2}\) is absurd, with a(p) being integer and \(p^{(k-1)/2}\) irrational. Let \({\mathbb {P}}\) be the set of all primes. We divide the proof for primes \(p\in {\mathcal {P}}\) and \(p\in {\mathbb {P}}\setminus {\mathcal {P}}.\) Since \(a^2(p)-4 p^{k-1}\ne 0,\) for any \(p\in {\mathcal {P}},\) we write \(a^2(p)-4 p^{k-1}=u^2 D_p,\) with \(D_p<0\) square-free and \(u\ne 0.\) Let us split the cases according to \(D_p \,(\mathrm{mod}\,\ell )\) is quadratic residue, zero or non quadratic residue modulo \(\ell .\) Set

$$\begin{aligned} {\mathbb {P}}= {\mathbb {P}}_{0} \cup {\mathbb {P}}_{1} \cup {\mathbb {P}}_{-1}, \quad \mathrm{where} \ {\mathbb {P}}_{\nu }=\left\{ \ell \in {\mathbb {P}}\;:\; \left( \frac{D_p}{\ell }\right) = \nu \right\} . \end{aligned}$$

For \(\nu = 0, 1, -1\), we also define

$$\begin{aligned} {\mathbb {P}}_{\nu }(x)={\mathbb {P}}_{\nu }\cap [1,x],\quad \pi _{\nu }(x) =\left| {\mathbb {P}}_{\nu }(x)\right| \quad \mathrm{and} \quad \kappa _{\nu }=\lim _{x \rightarrow \infty } \frac{\pi _{\nu }(x)}{\pi (x)}. \end{aligned}$$

It is clear that \(\pi _{\nu }(x)=\pi (x)(\kappa _{\nu }+o(1)),\) and \(\kappa _0+\kappa _1 + \kappa _{-1}=1.\)

Note that for a given prime p,  the associated polynomial \(\omega (x) (\mathrm{mod}\,\ell )\) has a single root in \({\mathbb {F}}_{\ell }\) if and only if \(u^2D_p \equiv 0 (\mathrm{mod}\,\ell ).\) Since such equation has finitely many solutions for \(\ell ,\) we get \(\kappa _0=0.\) On the other hand, Chebotarev’s density theorem implies that the uniform distribution of primes \(\ell \) such that \(\omega (x) \,(\mathrm{mod} \,\ell )\) is irreducible or has distinct roots in \({\mathbb {F}}_{\ell }\). Equivalently, the primes \(\ell \) satisfying \(\left( \tfrac{D_p}{\ell }\right) =\pm 1\) are distributed in the same proportion, therefore \(\kappa _{-1}=\kappa _1=1/2.\) We now turn to establish nontrivial exponential sums for \(\{a(p^n)\}(\mathrm{mod} \,\ell )\) with \(\ell \in {\mathbb {P}}_{\nu },\) for \(\nu =\pm 1.\)

3.3 Case 1. \(\ell \in {\mathbb {P}}_{-1}\):

we want to show that the inequality  (7) is satisfied by \(\frac{\pi (y)}{2}+O(y^{2\varepsilon })\) many primes \(\ell \le y\) in \({\mathbb {P}}_{-1}.\) In this case the associated polynomial (28) is irreducible modulo \(\ell ,\) then the idea is to employ Corollary 6. Let \(\alpha \) and \(\beta =\alpha ^{\ell }\) be the conjugate roots of (28) in its splitting field \({\mathbb {F}}_{\ell }(\alpha ).\) For a given \(\varepsilon >0,\) from Lemma 7 it follows that for \(\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell \le y,\) the following inequalities

$$\begin{aligned} \,\mathrm{ord}\,{\alpha ^{\ell }} = \,\mathrm{ord}\,{\alpha }> \ell ^{\varepsilon } \quad \mathrm{and} \quad \,\mathrm{ord}\,{\alpha \beta ^{-1}} =\,\mathrm{ord}\,{\alpha ^{1-\ell }} > \ell ^{\varepsilon } \end{aligned}$$
(29)

hold. Combining the identity

$$\begin{aligned} \,\mathrm{ord}\,{\alpha ^{\ell - 1}}=\frac{\,\mathrm{ord}\,{\alpha }}{\gcd (\,\mathrm{ord}\,{\alpha },\ell -1)} \end{aligned}$$

with the second inequality of (29), we get

$$\begin{aligned} \gcd (\,\mathrm{ord}\,{\alpha },\ell -1)=\frac{\,\mathrm{ord}\,{\alpha }}{\,\mathrm{ord}\,{\alpha ^{\ell - 1}}} = \frac{\,\mathrm{ord}\,{\alpha }}{\,\mathrm{ord}\,{\alpha ^{1 - \ell }}} < (\,\mathrm{ord}\,{\alpha }) \ell ^{-\varepsilon }. \end{aligned}$$

Applying Corollary 6 we complete the proof of this case.

3.4 Case 2. \(\ell \in {\mathbb {P}}_{1}\):

let \(\alpha ,\beta \) be the roots of \(\omega (x) (\mathrm{mod}\,\ell )\) inside \({\mathbb {F}}^*_{\ell }.\) From (17) it follows that for \(n\ge 0,\) \( a(p^n) \equiv c \alpha ^n + d \beta ^n (\mathrm{mod}\,\ell ),\) for some constants cd in \({\mathbb {F}}_{\ell },\) with \((\alpha , \beta )\ne (0,0).\) It is clear that \(\ell -1\) is a period of the sequence \(a(p^n) (\mathrm{mod}\,\ell ),\) and hence \(\tau \) divides \(\ell -1.\) We have

$$\begin{aligned} \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n)}\right) = \frac{\tau }{\ell -1} \sum _{n\le \ell -1} {\mathbf {e}}_{\ell }\left( {\xi a(p^n)}\right) = \frac{\tau }{\ell -1} \sum _{n\le \ell -1} {\mathbf {e}}_{\ell }\left( {\xi (c\alpha ^n + b \beta ^n)}\right) . \end{aligned}$$

From Lemma 7, there is a subset of \({\mathbb {P}}_{1}\) with \(\frac{\pi (y)}{2}+O(y^{2\varepsilon })\) many primes \(\ell \le y\) such that \(\,\mathrm{ord}\,{\alpha }, \,\mathrm{ord}\,{\beta }\) and \(\,\mathrm{ord}\,{(}\alpha \beta ^{-1})\) are bigger than \(\ell ^{\varepsilon }.\) It follows from [2, Corollary, page 479] that there exists a \(\delta =\delta (\varepsilon )>0\) such that

$$\begin{aligned} \max _{\begin{array}{c} (c,d)\in {\mathbb {F}}_{\ell } \times {\mathbb {F}}_{\ell } \\ (c,d)\ne (0,0) \end{array}} \left| \sum _{{ n \le \ell -1}} {\mathbf {e}}_{\ell }\left( {c \alpha ^n + d \beta ^n }\right) \right| \le \ell ^{1-\delta }. \end{aligned}$$

Hence, (i) of Theorem 2 holds. Now, assume that p belongs to the exceptional set \({\mathbb {P}}\setminus {\mathcal {P}},\) that is \(a(p^u)=0\) for some \(u\ge 1.\) We consider \(u=u(p)\) to be the least such integer. Since the discriminant is nonzero (the roots \(\alpha \) and \(\beta \) of (28) are distinct), we getFootnote 3

$$\begin{aligned} a(p^u)=\frac{\alpha ^{u+1}-\beta ^{u+1}}{\alpha - \beta }=0. \end{aligned}$$

Set \(b(u+1)=a(p^u)\), then it follows that for all \(n\ge 1\) we have

$$\begin{aligned} b(n(u+1))=a(p^{n(u+1)-1})=\frac{\alpha ^{n(u+1)} -\beta ^{n(u+1)}}{\alpha - \beta }=0. \end{aligned}$$

Therefore,

$$\begin{aligned} \sum _{n\le \tau }{\mathbf {e}}_{\ell }\left( {\xi a(p^n)}\right)&= \sum _{n=0}^{\tau -1}{\mathbf {e}}_{\ell }\left( {\xi b(n+1)}\right) = \left( \sum _{n=0}^{ \lfloor \tau /(u+1)\rfloor } \sum _{e=0}^{u} {\mathbf {e}}_{\ell }\left( {\xi b({n(u+1) +e})}\right) \right) \nonumber \\&\quad + O(u)\nonumber \\&= \left( \sum _{n=0}^{ \lfloor \tau /(u+1)\rfloor } {\mathbf {e}}_{\ell }\left( {\xi b({n(u+1)})}\right) +\sum _{e=1}^{u}\sum _{n=0}^{\lfloor \tau /(u+1)\rfloor } {\mathbf {e}}_{\ell }\left( {\xi b({n(u+1) +e})}\right) \right) \nonumber \\&\quad + O(u)\nonumber \\&= \lfloor \frac{\tau }{u+1}\rfloor + \left( \sum _{e=1}^{u} \sum _{n=0}^{\lfloor \tau /(u+1)\rfloor } {\mathbf {e}}_{\ell }\left( {\xi b({n(u+1) +e})}\right) \right) + O(u). \end{aligned}$$
(30)

First of all observe that u is odd. As otherwise, if u is even then we would get

$$\begin{aligned} \alpha ^{u+1}+\beta ^{u+1}=2\alpha ^{u+1}=\pm 2p^{\frac{(u+1)(k-1)}{2}}, \end{aligned}$$

which is absurd as \(\alpha ^{u+1}+\beta ^{u+1}\) is a rational, but \(p^\frac{(u+1)(k-1)}{2}\) is not. Now, for any \(0<e<u+1\) we have

$$\begin{aligned} b((u+1)n+e)=\alpha ^{(u+1)n}\frac{(\alpha ^e-\beta ^e)}{\alpha -\beta } =\left( \pm p^{\frac{(u+1)(k-1)}{2}} \right) ^{n}a(p^{e-1}), \end{aligned}$$

where the sign on the right hand side above depends on the sign of \(\alpha ^{u+1}.\) Without loss of generality, we are assuming that this sign is negative. It is easy to see that our next argument applies to the positive sign case as well. Since u is fixed, so are all the e’s up to \(u-1.\) In particular, we may consider large primes \(\ell \) for which all of the \(a(p^{e}) \not \equiv 0 (\mathrm{mod}\,\ell )\) for any \(1 \le e \le u-1.\) Then, we have

$$\begin{aligned} \sum _{n=0}^{ \tau /(u+1)} {\mathbf {e}}_{\ell }\left( {\xi b({n(u+1) +e})}\right) =\sum _{n=0}^{ \tau /(u+1)} {\mathbf {e}}_{\ell }\left( {\xi \left( -p^{\frac{(u+1)(k-1)}{2}}\right) ^n a(p^{e-1})}\right) . \end{aligned}$$

Due to Lemma 7, we may assume that \(t_u=\,\mathrm{ord}\,{(-p^{(k-1)(u+1)/2})} >\ell ^{\varepsilon }\) holds for \(\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell \le y\). Now, by [4, Corollary 1] it follows that

$$\begin{aligned} \left| \sum _{n\le t} {\mathbf {e}}_{\ell }\left( {\xi \left( -p^{\frac{(u+1)(k-1)}{2}}\right) ^n a(p^{e-1})}\right) \right| \le t \ell ^{-\delta }, \quad \mathrm{for}\ \mathrm{some}\ \delta =\delta (\varepsilon /2)>0, \end{aligned}$$
(31)

and for any \(t_u \ge t > \ell ^{\varepsilon }\).

Writing \([\tau /(u+1)]=q t_u + r,\) with \(0\le r < t_u\) it follows that

$$\begin{aligned} \sum _{n\le \tau /(u+1)}{\mathbf {e}}_{\ell }\left( {\xi \alpha ^{{(u+1)n}}a(p^{e-1})}\right)&= q \sum _{n\le t_u}{\mathbf {e}}_{\ell }\left( {\xi \alpha ^{{(u+1)n}}a(p^{e-1})}\right) \\&\quad + \sum _{n\le r}{\mathbf {e}}_{\ell }\left( {\xi \alpha ^{{(u+1)n}}a(p^{e-1})}\right) . \end{aligned}$$

The estimate \(\left| \sum _{n\le t_u}{\mathbf {e}}_{\ell }\left( {\xi \alpha ^{{(u+1)n}}a(p^{e-1})}\right) \right| \le t_u \ell ^{-\delta }\) follows from (31). If \(r \le \ell ^{\varepsilon /2},\) then we get trivially \(\left| \sum _{n\le r} {\mathbf {e}}_{\ell }\left( {\xi \alpha ^{{(u+1)n}}a(p^{e-1})}\right) \right| \le \ell ^{\varepsilon /2}.\) If \(\ell ^{\varepsilon /2} \le r <t_u,\) then from (31) it follows that

$$\begin{aligned} \left| \sum _{n\le r} {\mathbf {e}}_{\ell }\left( {\xi \alpha ^{{(u+1)n}}a(p^{e-1})}\right) \right| \le t_u \ell ^{-\delta }. \end{aligned}$$

Therefore,

$$\begin{aligned} \left| \sum _{n\le r} {\mathbf {e}}_{\ell }\left( {\xi \alpha ^{{(u+1)n}}a(p^{e-1})}\right) \right| \le \max \left\{ \ell ^{\varepsilon /2}, t_u \ell ^{-\delta }\right\} . \end{aligned}$$

Recalling that \(t_u \ge \ell ^{\varepsilon },\) we can also assume that \(t_u \ell ^{-\delta }\ge \ell ^{\varepsilon /2}\) by taking small enough \(\delta .\) Thus,

$$\begin{aligned} \left| \sum _{n\le \tau /(u+1)}{\mathbf {e}}_{\ell }\left( {\xi \alpha ^{{(u+1)n}}a(p^{e-1})}\right) \right| \le (q t_u+ t_u) \ell ^{-\delta } \ll \frac{\tau }{u+1}\ell ^{-\delta }. \end{aligned}$$

Finally, combining the above inequality with (30) we obtain

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*}\left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n) }\right) \right|&=\left\lfloor \frac{\tau }{u+1}\right\rfloor + O\left( \tau \ell ^{-\delta }+u\right) \\&=\frac{\tau }{u+1}+O\left( \tau \ell ^{-\delta }+u\right) . \end{aligned}$$

This conclude the proof for all exceptional set of primes \(p\in {\mathbb {P}}\setminus {\mathcal {P}}.\)

3.5 Consequences of Theorem 2

Let us consider an exponential sum of type \(S(p,x,\alpha )=\sum _{p^n\le x} \mathbf {e}(\alpha a(p^n)),\) for \(\alpha \in [0,1].\) As one of the consequences of Theorem 2, we want to study this exponential sum when \(\alpha \) is a rational whose denominator is a prime. In this regard, we have the following result.

Corollary 8

Let f be an eigenform of weight k and level N with rational coefficient. Then for a given \( 0< \varepsilon < 1/2,\) there exists a \(\delta (\varepsilon )>0\) such that for at least \(\gg \frac{(\log x)^{1 - \delta /(2+\delta )}}{\log \log x}\) many primes \(\ell ,\) we have the following estimates:

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^{*}}\left| \sum _{p^n \le x} {\mathbf {e}}_{\ell }\left( {\xi a(p^n)}\right) \right| =\left\{ \begin{array}{cccccccc} O\left( (\log x / \log p)^{1 - \delta /(2+\delta )}\right) &{} \mathrm{{if}} \quad p\notin {\mathcal {P}} \\ &{} \\ \frac{1}{u+1}\frac{\log x}{\log p} +O\left( (\log x / \log p)^{1 - \delta /(2+\delta )}\right) &{} \mathrm{{if }} \quad p\in {\mathcal {P}} \end{array}\,. \right. \end{aligned}$$

Proof

Consider the same \(\delta :=\delta (\varepsilon )\) as in Theorem 2 and any prime

$$\begin{aligned} \ell \in \left[ (\log x / \log p)^{1/2 - \delta / (4+2\delta )},2 (\log x / \log p)^{1/2 - \delta / (4+2\delta )}\right] . \end{aligned}$$

Following Theorem 2, we have

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^{*}}\left| \sum _{n \le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n)}\right) \right| \le \frac{\tau }{\ell ^{\delta }} \end{aligned}$$
(32)

holds, for at least \(\gg \frac{(\log x)^{1 - \delta / (2+\delta )}}{\log \log x}\) primes \(\ell .\) For these primes, we also have \(\tau \le \ell ^2<\frac{\log x}{\log p}.\) In particular,

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^{*}} \left| \sum _{p^n \le x} {\mathbf {e}}_{\ell }\left( {\xi a(p^n)}\right) \right| \le \frac{\log x}{ \ell ^{\delta } \log p} +O\left( \ell ^2\right) =O\left( (\log x / \log p)^{1 - \delta /(2+\delta )}\right) . \end{aligned}$$

On the other hand, let \(p\in {\mathcal {P}}\) be a prime, then by Theorem 2 we have

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^{*}}\left| \sum _{n \le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n)}\right) \right| =\frac{\tau }{u+1} +O\left( \frac{\tau }{\ell ^{\delta }}+u\right) , \end{aligned}$$

holds, for some u depending on p,  and for at least \(\gg \frac{(\log x)^{1 - \delta /(2+\delta )}}{\log \log x}\) primes \(\ell .\) Due to Lemma 7, we can assume that \(\tau >\ell ^{\delta }\) holds by choosing small enough \(\delta ,\) for at least \(\gg \frac{(\log x)^{1 - \delta /(2+\delta )}}{\log \log x}\) primes \(\ell .\) Arguing similarly as in the previous case, we get the desired main term, and the error term that we get

$$\begin{aligned} O\left( \frac{\log x}{\ell ^{\delta }\log p} +\frac{u\log x}{\tau \log p}\right) =O\left( \frac{\log x}{\ell ^{\delta }\log p}\right) =O\left( (\log x / \log p)^{1 - \delta /(2+\delta )}\right) , \end{aligned}$$

where the last equality holds because \(\tau >\ell ^{\delta }\). \(\square \)

Corollary 9

Let f be an eigenform of weight k and level N with rational coefficients. For \(\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell \le y\) we have the following property. Given \(0< \varepsilon < 1/2\) and \(p_1,\cdots ,p_{\nu }\) be any set of distinct primes such that \(a(p_i^u) \ne 0\) for all \(u\ge 1\) and \(1 \le i \le \nu ,\) there exists a \(\delta =\delta (\varepsilon )>0\) such that

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n_1 \le \tau _1} \cdots \sum _{n_{\nu } \le \tau _{\nu }} {\mathbf {e}}_{\ell }\left( {\xi a(p_1^{n_1} \cdots p_{\nu }^{n_{\nu }})}\right) \right| \le \tau _1 \cdots \tau _{\nu } \ell ^{-\delta }. \end{aligned}$$

Proof

Set

$$\begin{aligned} S_{\nu }(\xi )=\left| \sum _{n_1 \le \tau _1} \cdots \sum _{n_{\nu } \le \tau _{\nu }} {\mathbf {e}}_{\ell }\left( {\xi a(p_1^{n_1} \cdots p_{\nu }^{n_{\nu }})}\right) \right| . \end{aligned}$$

We proceed by induction. Case \(\nu =1\) is done by Theorem 2. Now, by multiplicativity it follows that

$$\begin{aligned} |S_{\nu }(\xi )|&\le \sum _{n_1 \le \tau _1} \left| \sum _{n_2 \le \tau _2} \cdots \sum _{n_{\nu } \le \tau _{\nu }} {\mathbf {e}}_{\ell }\left( { \xi a (p_{1}^{n_{1}}) a(p_2^{n_2} \cdots p_{\nu }^{n_{\nu }})}\right) \right| \\&\le \tau _2 \cdots \tau _{\nu } \sum _{\begin{array}{c} {n_1 \le \tau _1} \\ a(p_1^{n_1}) \equiv 0 \,(\mathrm{mod}\,\ell ) \end{array}} 1 + \sum _{\begin{array}{c} {n_1 \le \tau _1} \\ a(p_1^{n_1})\not \equiv 0 \,(\mathrm{mod}\,\ell ) \end{array}} \left| \sum _{n_2 \le \tau _2} \cdots \sum _{n_{\nu } \le \tau _{\nu }} {\mathbf {e}}_{\ell }\left( { \xi a (p_{1}^{n_{1}}) a(p_2^{n_2} \cdots p_{\nu }^{n_{\nu }})}\right) \right| \end{aligned}$$

By induction hypothesis, the second term on the right hand side of the above equation is bounded by \(\tau _1\tau _2 \cdots \tau _{\nu }\ell ^{-\delta },\) for some \(\delta >0\) depending on \(\varepsilon .\) On the other hand, note that \(\sum _{\begin{array}{c} {n_1 \le \tau _1} \\ a(p_1^{n_1}) \equiv 0 \,(\mathrm{mod}\,\ell ) \end{array}}1 \) counts the number of solutions of the congruence

$$\begin{aligned} a(p^n_1) \equiv 0 \,(\mathrm{mod}\,\ell ), \qquad n \le \tau _1. \end{aligned}$$

Writing it as exponential sum we get

$$\begin{aligned} \sum _{\begin{array}{c} {n_1 \le \tau _1} \\ a(p_1^{n_1}) \equiv 0 \,(\mathrm{mod}\,\ell ) \end{array}}1&= \frac{1}{\ell } \sum _{x =0}^{\ell -1}\sum _{n_1 \le \tau _1} {\mathbf {e}}_{\ell }\left( {x (a(p_1^{n_1}) )}\right) \\&= \frac{\tau _1}{\ell } + O\left( \max _{x \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n_1 \le \tau _1} {\mathbf {e}}_{\ell }\left( {x (a(p_1^{n_1}))}\right) \right| \right) . \end{aligned}$$

We can bound the error term by Theorem 2 and without loss of generality assuming \(\delta <1,\) we get the sum above is simply \(\frac{\tau _1}{\ell } + O(\tau _1 \ell ^{-\delta }).\) This is further bounded by \( 2\tau _1\ell ^{-\delta },\) because the explicit constant in Theorem 2 is exactly 1. Therefore,

$$\begin{aligned} |S_{\nu }(\xi )|\le \tau _2\cdots \tau _v\left( 2\tau _1\ell ^{-\delta }\right) + \tau _1\tau _2 \cdots \tau _{\nu }\ell ^{-\delta }, \end{aligned}$$

for some \(\delta =\delta (\varepsilon )>0.\) This shows that the inequality

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n_1 \le \tau _1} \cdots \sum _{n_{\nu } \le \tau _{\nu }} {\mathbf {e}}_{\ell }\left( {\xi a(p_1^{n_1} \cdots p_{\nu }^{n_{\nu }})}\right) \right| \le 3\tau _1 \cdots \tau _{\nu } \ell ^{-\delta } \end{aligned}$$

holds for almost all prime \(\ell \) and this completes the proof because we can remove the extra factor 3 by taking primes \(\ell \) large enough. \(\square \)

4 Exponential sums for modular forms: beyond eigenforms

We shall now prove Theorem 3. Write

$$\begin{aligned} a_{f}(p^n)=\sum _{i=1}^{r} a_i a_{f_i}(p^n), \end{aligned}$$

where \(a_i\in {\mathbb {Q}},\) and \(f_i\) is a newform with rational coefficients for every \(1\le i \le r\). Let \(\omega ^{(i,p)}\) be the characteristic polynomial of \(a_{f_i}(p^n)\) and \(D_i(p)\) be its discriminant.

Consider

$$\begin{aligned} {\mathcal {S}}_1=\left\{ \ell ~\text {prime} \mid \left( \frac{D_i(p)}{\ell }\right) =1, \forall 1\le i\le r\right\} . \end{aligned}$$

It is clear that \({\mathcal {S}}_1\) has positive density. One can verify this by considering primes congruent to 1 modulo \(8\prod _{i=1}^{r}D_i(p).\) This works well because, we then have

$$\begin{aligned} \left( \frac{-1}{\ell }\right) =1,\left( \frac{2}{\ell }\right) =1~ \mathrm{and}~\left( \frac{\ell }{\mathrm{odd}(D_i(p))}\right) =1, \forall 1\le i\le r, \end{aligned}$$

where \(\mathrm{odd}(.)\) denotes odd part of the corresponding number. These conditions altogether imply \(\ell \in {\mathcal {S}}_1.\) Let \(\alpha ^{(i,p)}\) and \(\beta ^{(i,p)}\) be the roots of \(\omega ^{(i,p)}.\) So for any \(\ell \in {\mathcal {S}}_1,\) we can write

$$\begin{aligned} \omega ^{(i,p)}(x) \,(\mathrm{mod}\,\ell )=\prod _{1\le i \le r} \left( x-\alpha ^{(i,p)}_{\ell }\right) \left( x-\beta _{\ell }^{(i,p)}\right) , \end{aligned}$$

where for every ij, \(\alpha ^{(i,p)}_{\ell },\beta ^{(j,p)}_{\ell }\) are in \({\mathbb {F}}_{\ell }.\) Now, we consider the set of primes

$$\begin{aligned} {\mathcal {S}}_2&= \left\{ p~\mathrm{prime} \mid \alpha ^{(i,p)} (\beta ^{(j,p)})^{-1}~\text {is not root of unity,}~\forall ~i,j\right\} \\&\quad \cup \left\{ p~\mathrm{prime} \mid \alpha ^{(i,p)} (\alpha ^{(j,p)})^{-1}~\text {is not root of unity,} ~\forall i\ne j\right\} . \end{aligned}$$

Lemma 10

For any prime \(p\in {\mathcal {S}}_2,\) the following inequalities are true for \(\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell \le y.\)

  1. (1)

    \(\,\mathrm{ord}\,{(}\alpha ^{(i,p)}_{\ell }(\beta ^{(j,p)}_{\ell })^{-1}) >\ell ^{\varepsilon }\), \(\,\mathrm{ord}\,{(}\alpha ^{(i,p)}_{\ell }) >\ell ^{\varepsilon }\) and \(\,\mathrm{ord}\,{(}\beta ^{(j,p)}_{\ell }) >\ell ^{\varepsilon }, \) for all \(1 \le i,j \le r\), and

  2. (2)

    \(\,\mathrm{ord}\,{(}\alpha ^{(i,p)}_{\ell }(\alpha ^{(j,p)}_{\ell })^{-1}) >\ell ^{\varepsilon },\) for all \(1\le i \ne j \le r\),

Proof

It is enough to prove the result only for \(i,j \in \{1,2\}.\) Consider the Galois extension \(K={\mathbb {Q}}\left( \alpha ^{(1,p)},\alpha ^{(2,p)}\right) .\) Let \(\mathfrak {L}\) be a prime ideal lying over \(\ell \) in \({\mathcal {O}}_K.\) It is clear that

$$\begin{aligned} \{\alpha ^{(1,p)}_{\ell }, \alpha ^{(2,p)}_{\ell }, \beta ^{(1,p)}_{\ell }, \beta ^{(2,p)}_{\ell }\} =\{\alpha ^{(1,p)}, \alpha ^{(2,p)}, \beta ^{(1,p)}, \beta ^{(2,p)}\} (\mathrm{mod}\,\mathfrak {L}), \end{aligned}$$
(33)

because both of these sets serve as a set of roots of the equation \(\omega (x)\,(\mathrm{mod}\,\ell )\) and \(\omega (x)\,(\mathrm{mod} \,\mathfrak {L})\) respectively. Note that \(\omega (x)\,(\mathrm{mod} \,\mathfrak {L})\) coincides with \(\omega (x)\,(\mathrm{mod}\,\ell ).\) It follows from (33) that the right hand side does not depend on the choice of prime \(\mathfrak {L}\) lying over \(\ell ,\) so there is no problem in working with a fixed \(\mathfrak {L}\) lying over \(\ell .\) It is now clear that,

$$\begin{aligned} \left\{ \alpha ^{(i,p)}_{\ell }(\beta ^{(j,p)}_{\ell })^{-1} \right\} _{1\le i,j\le 2}=\left\{ \alpha ^{(i,p)} (\beta ^{(j,p)})^{-1}\right\} _{1\le i,j\le 2} (\mathrm{mod}\,\mathfrak {L}). \end{aligned}$$

Consider \(R(T)=\mathrm{Res}\left( \omega _1(x), g_T(x)\right) ,\) where \(\omega _1(x)=\left( x-\alpha ^{(1,p)}\right) \left( x-\beta ^{(1,p)}\right) \) and

$$\begin{aligned} g_T(x)=\prod _{t\le T}\left( x^t-\alpha ^{(2,p)t}\right) \left( x^t-\beta ^{(2,p)t}\right) . \end{aligned}$$

It is clear that \(R(T)\ne 0\) for any \(T\in {\mathbb {N}}\) as \(p\in {\mathcal {S}}_2\) by assumption. Now, consider the set of primes

$$\begin{aligned} \left\{ \ell ~\mathrm{prime}\mid \mathrm{ord} \left( \alpha ^{(i,p)}_{\ell }(\beta ^{(j,p)}_{\ell })^{-1}\right) , \mathrm{ord}\left( \alpha ^{(i,p)}_{\ell } (\alpha ^{(j,p)}_{\ell })^{-1}\right) \le T~\mathrm{for}\ \mathrm{some}~i \ne j\in \{1,2\}\right\} . \end{aligned}$$
(34)

For any prime \(\ell \) in the set above, and for any prime \(\mathfrak {L}\) in \({\mathcal {O}}_K\) lying over \(\ell ,\) \(\omega _1(x) \,(\mathrm{mod}\,\mathfrak {L})\) and \(g_T(x)\,(\mathrm{mod}\,\mathfrak {L})\) have a common root, Therefore, \(R(T)(\mathrm{mod}\,\mathfrak {L})=0.\) Since both \(\omega _1(x)\) and \(g_T(x)\) are in \({\mathbb {Z}}[x],\) it is clear that \(R(T) \in {\mathbb {Z}},\) and so \(R(T) \,(\mathrm{mod} \,\ell ) =0\) as well. Now, one can estimate the number of prime divisors of R(T) similar to as in Lemma 7. This shows that

$$\begin{aligned} \mathrm{ord}\left( \alpha ^{(i,p)}_{\ell }(\beta ^{(j,p)}_{\ell })^{-1}\right)> \ell ^{\varepsilon },~\mathrm{and}~\mathrm{ord}\left( \alpha ^{(i,p)}_{\ell } (\alpha ^{(j,p)}_{\ell })^{-1}\right) > \ell ^{\varepsilon } \end{aligned}$$

holds for all \(i\ne j \in \{1,2\},\) and \(\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell \le y.\) Rest of the cases can be dealt with Lemma 7. \(\square \)

4.1 GST: Beyond Sato-Tate

We shall now give a short overview of Sato-Tate distribution. When f is a newform without CM, then Sato-Tate conjecture says that the normalized coefficients \(\frac{a(p)}{2p^{\frac{k-1}{2}}}\) are equidistributed in \([-1,1]\) with respect to the measure

$$\begin{aligned} \mu _{\mathrm{non}-CM}=\frac{2}{\pi }\int \sin ^2(\theta ) \,\mathrm{d}\theta . \end{aligned}$$

On the other hand, if f is with CM, then the corresponding Sato-Tate distribution is

$$\begin{aligned} \mu _{CM}=\frac{1}{2\pi }\int \frac{\,\mathrm{d}x}{\sqrt{1-x^2}} =\frac{1}{2\pi }\int 1 \,\mathrm{d}\theta , \end{aligned}$$

on \([0,\pi ]-\{\frac{\pi }{2}\}\). Moreover at \(\theta _p=\frac{\pi }{2},\) a(p) becomes zero and it is known that the set of such primes p has density exactly \(\frac{1}{2}.\) Now, consider the L-function defined by

$$\begin{aligned} L(s,\mathrm{Sym}^m f)=\prod _{p\not \mid N}\prod _{i=0}^{m} \left( 1-\alpha _p^i\beta _p^{m-i}p^{-s}\right) ^{-1}, \end{aligned}$$

where \(\alpha _p,\beta _p\) are normalized roots of (28). In other words, if \(\widetilde{\alpha }_p,\widetilde{\beta }_p\) are the roots of (28), then we define \(\alpha _p=\frac{\widetilde{\alpha }_p}{p^{\frac{k-1}{2}}}, \beta _p=\frac{\widetilde{\beta }_p}{p^{\frac{k-1}{2}}}.\) Serre in [22] showed that if for all integer \(m \ge 0, L(s, \mathrm{Sym}^m(f))\) extends analytically to \(\mathrm{Re}(s) \ge 1\) and does not vanish there, then the Sato-Tate conjecture holds true for f. Note that Barnet-Lamb et al. have proved the conjecture in [1] working with this L-function. However, to estimate the size of \({\mathcal {S}}_2\) we will have more than one newform to play with, and it will be helpful to have their distributions independent. This independency property is stated as Generalized Sato-Tate (GST) hypothesis. In this article, we shall always work with the newforms that obey this hypothesis. For example, in Theorem 3, it is assumed that all the associated newforms satisfy the GST hypothesis.

4.2 A consequence of GST

To prove Theorem 3, we need to study the set \({\mathcal {S}}_2.\) We have that luxury when the associated newforms satisfy GST.

Lemma 11

Suppose that there are \(r_1\) many components without CM and \(r_2\) many components with CM in f. Then under the GST hypothesis, density of \({\mathcal {S}}_2\) is \(2^{-r_2}.\)

Proof

We start by writing

$$\begin{aligned} \alpha ^{(j,p)}=p^{\frac{k-1}{2}}e^{i\theta _{j,p}},\beta ^{(j,p)} =p^{\frac{k-1}{2}}e^{-i\theta _{j,p}}, \forall 1\le j\le r. \end{aligned}$$

So, the problem reduced to study the set of primes

$$\begin{aligned} \left\{ p~\mathrm{prime} \mid \theta _{i,p} \pm \theta _{j,p}\in {\mathbb {Q}}\times \pi , ~\text {for some}~1\le i,j\le r\right\} . \end{aligned}$$
(35)

It follows from the discussion above that the density of this set is bounded by

$$\begin{aligned} \left( \frac{2}{\pi }\right) ^{r_1}\left( \frac{1}{2\pi }\right) ^{r_2} \idotsint \limits _{S}\sin ^2(\theta _1)\sin ^2(\theta _2) \cdots \sin ^2(\theta _{r_1})\,\mathrm{d}\theta _1 \,\mathrm{d}\theta _2\cdots \,\mathrm{d}\theta _r, \end{aligned}$$
(36)

where \(S=\left\{ (\theta _1,\theta _2,\cdots ,\theta _r) \in [0,\pi ]^r \mid \theta _{i}\pm \theta _{j}\in {\mathbb {Q}}\times \pi ~\text {for some}~1\le i,j\le r\right\} .\) Just for the sake of simplicity and to have a feel of what is going on, let us first do the case when there is only one component.

Case 1 \(r=1\): suppose that the given component is without CM. If \(\alpha _p^{(1,p)}\beta _p^{-(1,p)}\) is a root of unity then this implies that \(\theta _{1,p} \in \pi \times {\mathbb {Q}}.\) By Sato-Tate, density of such primes is bounded by

$$\begin{aligned} \left( \frac{2}{\pi }\right) \int \limits _{\theta \in \pi \times {\mathbb {Q}}}\sin ^2(\theta ) \,\mathrm{d}\theta . \end{aligned}$$

Since the integral above runs over a set of measure zero, the integral is zero, and for this particular case density of \({\mathcal {S}}_2\) is indeed 1. Now, suppose that the given component is with CM. In this case, the density of \({\mathcal {S}}_2\) is

$$\begin{aligned} \left( \frac{1}{2\pi }\right) \int \limits _{\theta \in [0,\pi ] \setminus \pi \times {\mathbb {Q}}}\sin ^2(\theta ) \,\mathrm{d}\theta =\frac{1}{2}. \end{aligned}$$

Case 2 \(r\ge 2\): for this general case, it is enough to show that the integral over S in (36) is zero. This is because, due to GST, we are now working with the measure

$$\begin{aligned} \left( \frac{2}{\pi }\right) ^{r_1}\left( \frac{1}{2\pi }\right) ^{r_2} \idotsint \sin ^2(\theta _1)\sin ^2(\theta _2)\cdots \sin ^2(\theta _{r_1}) \,\mathrm{d}\theta _1 \,\mathrm{d}\theta _2\cdots \,\mathrm{d}\theta _r, \end{aligned}$$
(37)

and with respect to this measure, \([0,\pi ]^r\) has measure \(\left( \frac{1}{2}\right) ^{r_2}.\) We can write \(S=\bigcup _{1\le i,j\le r} S_{i,j}\), where the set \(S_{i,j}\) is defined to be the tuples for which \(\theta _i\pm \theta _j\in {\mathbb {Q}}\times \pi .\) It is now enough to show that each of these sets \(S_{i,j}\) has a zero measure. Note that the integral over \(S_{i,j}\) is crudely bounded by \(\iint \limits _{S_{i,j}}1\,\mathrm{d}\theta _i \,\mathrm{d}\theta _j.\) It is evident that

$$\begin{aligned} \iint \limits _{S_{i,j}}1\,\mathrm{d}\theta _i \,\mathrm{d}\theta _j&= \iint \limits _{\theta _i+\theta _j \in {\mathbb {Q}} \times \pi }1\,\mathrm{d}\theta _i \,\mathrm{d}\theta _j \; +\iint \limits _{\theta _i-\theta _j \in {\mathbb {Q}} \times \pi }1\,\mathrm{d}\theta _i \,\mathrm{d}\theta _j, \end{aligned}$$

as \({\mathbb {Q}}\times {\mathbb {Q}}\) has zero measure. We now note that

$$\begin{aligned} \iint \limits _{\theta _i-\theta _j \in (a,b)}1\,\mathrm{d}\theta _i \,\mathrm{d}\theta _j \le \int \limits _{0}^{\pi }\int \limits _{a}^{b}1 \,\mathrm{d}t \,\mathrm{d}\theta \ll |b-a|, \end{aligned}$$
(38)

for any \(b>a.\) In particular, for any \(\varepsilon >0,\)

$$\begin{aligned} \iint \limits _{\theta _i - \theta _j \in {\mathbb {Q}} \times \pi }1\,\mathrm{d}\theta _i\,\mathrm{d}\theta _j \ll \sum _{k=1}^{\infty } \frac{\varepsilon }{2^k}=\varepsilon . \end{aligned}$$

The last implication above follows from the standard argument to show a countable set always has a zero measure. In particular, the second integral of (38) is zero. On the other hand, just by replacing \(\theta _j\) with \(\pi -\theta _j,\) we get

$$\begin{aligned} \iint \limits _{\theta _i+\theta _j \in {\mathbb {Q}}\times \pi } 1\,\mathrm{d}\theta _i \,\mathrm{d}\theta _j=-\iint \limits _{\theta _i - \theta _j \in {\mathbb {Q}}\times \pi }1\,\mathrm{d}\theta _i\,\mathrm{d}\theta _j. \end{aligned}$$

This just shows that the integral over \(S_{i,j}\) at (38) is zero, which completes the proof. \(\square \)

4.3 Proof of Theorem 3

Let \(p\in {\mathcal {S}}_2\) be a prime, then we can write

$$\begin{aligned} \sum _{i=1}^{r} a_ia_{f_i}(p^n)\,(\mathrm{mod}\,\ell ) =\sum _{i=1}^r a_i^{(\ell )}\left( c^{(i,\ell )}\alpha ^{n(i,\ell )} +d^{(i,\ell )}\beta ^{n(i,\ell )}\right) , \end{aligned}$$

where \(a_i^{(\ell )}, c^{(i,\ell )}\) and \(d^{(i,\ell )}\) are all in \({\mathbb {F}}_{\ell }.\) On the other hand, all the roots \(\alpha ^{(i,\ell )}\) and \(\beta ^{(i,\ell )}\) are in \({\mathbb {F}}_{\ell },\) as \(\ell \in {\mathcal {S}}_1.\) The proof now follows by [2, Corollary, p. 479] combining with Lemmas 10 and 11. \(\square \)

Remark 2

It is known, due to Thorner, that GST holds for \(r=2\) when both \(f_1\) and \(f_2\) are without CM and not twist-equivalent. We say that \(f_1\) and \(f_2\) are twist-equivalent if there exists a primitive Dirichlet character \(\chi \) such that \(f_1 = f_2 \otimes \chi .\) For more details, we refer the reader to Theorem 1.3 in [27].

5 Exponential sums for modular forms: the inverse case

One may now ask that for a given prime \(\ell \) and small enough \(\varepsilon ,\) how many primes p are there for which an estimate like (7) holds. Our attempt to answer this question is summarized in the form of Theorems 4 and 5. Let us begin with the proof of Theorem 4.

5.1 Proof of Theorem 4

For any prime p, let us denote the roots of \(x^2-a(p)x+p^{k-1}\,(\mathrm{mod}\,\ell )\) by \(\alpha _{p}^{(\ell )}, \beta _{p}^{(\ell )}.\) Recall that from Deligne-Serre correspondence, we have the associated Galois representation

$$\begin{aligned} \rho _{f}^{(\ell )}:\text {Gal}\left( \overline{{\mathbb {Q}}}/ {\mathbb {Q}}\right) \longrightarrow \mathrm{GL}_2 \left( {\mathbb {Z}}_{\ell }\right) , \end{aligned}$$

such that \(a(p)=\text {tr}\left( \rho _{f}^{(\ell )} (\text {Frob}_p)\right) \) for any prime \(p \not \mid N\ell .\) It is clear that the characteristic polynomial of \(\rho _f^{(\ell )}(\text {Frob}_p)(\mathrm{mod}\,\ell )\) is same as \(x^2-a(p)x+p^{k-1}\,(\mathrm{mod}\,\ell )\). Following Ribet [21, Theorem 3.1], it is known that the image of this representation is \(\left\{ A \in \text {GL}_2\left( {\mathbb {Z}}_{\ell }\right) \mid \det (A) \in ({\mathbb {Z}}_{\ell }^{*})^{k-1}\right\} ,\) except possibly for finitely many primes \(\ell .\) In particular, the condition \((k-1,\ell -1)=1\) implies that the induced Galois representation

$$\begin{aligned} \rho _{f,\ell }:\text {Gal}\left( \overline{{\mathbb {Q}}}/ {\mathbb {Q}}\right) \longrightarrow \mathrm{GL}_2 \left( {\mathbb {F}}_{\ell }\right) , \end{aligned}$$

is surjective for any large prime \(\ell ,\) and the eigenvalues of the matrix \(\rho _{f,\ell }(\text {Frob}_p) \in \text {GL}_2\left( {\mathbb {F}}_{\ell }\right) \) are \(\alpha _{p}^{(\ell )}\) and \(\beta _{p}^{(\ell )}.\) From the proof of Theorem 2, we know that an estimate of type (7) holds provided that,

$$\begin{aligned} \,\mathrm{ord}\,{(}\alpha _{p}^{(\ell )})> \ell ^{\varepsilon }, \,\mathrm{ord}\,{(}\beta _{p}^{(\ell )})> \ell ^{\varepsilon }, ~\text {and}~\,\mathrm{ord}\,{(}\alpha _{p}^{(\ell )}(\beta _{p}^{(\ell )})^{-1}) > \ell ^{\varepsilon }. \end{aligned}$$

Let us define,

$$\begin{aligned} C=\left\{ A\in \mathrm{GL}_2({\mathbb {F}}_{\ell }) \mid \,\mathrm{ord}\,{(}\lambda _{1,A}), \,\mathrm{ord}\,{(}\lambda _{2,A}), \,\mathrm{ord}\,{(}\lambda _{1,A} \lambda _{2,A}^{-1})>\ell ^{\varepsilon }\right\} , \end{aligned}$$

where \(\lambda _{1,A},\lambda _{2,A}\) are the eigenvalues of A in \({\mathbb {F}}_{\ell ^2}^{*}.\) Now the problem is about computing the density of primes p for which the corresponding \(\rho _{f,\ell }\left( \text {Frob}_p\right) \) is in C. Note that C is a subset of \(\text {GL}_2({\mathbb {F}}_{\ell })\) stable under conjugation. Hence, by Chebotarev’s density theorem, the required density is at least \(\frac{|C|}{|\text {GL}_2 \left( {\mathbb {F}}_{\ell }\right) |}.\) For each \(a \ne b \in {\mathbb {F}}_{\ell }^{*},\) let \(C_{a,b}\) be the conjugacy class of \(\left( \begin{array}{c} {a} \\ {0} \end{array}\begin{array}{c} {0} \\ {b} \end{array}\right) .\) It is known that \(|C_{a,b}|=(\ell +1)\ell .\) For any element \(\lambda \) in \({\mathbb {F}}_{\ell ^2}\setminus {\mathbb {F}}_{\ell },\) we denote \(c_{\lambda }\) to be the conjugacy class of matrices in \(\text {GL}_2\left( {\mathbb {F}}_{\ell }\right) \) having eigenvalue \(\lambda .\) It is known that \(|C_{\lambda }|=\ell (\ell -1).\) Now, we consider the following sets:

$$\begin{aligned} S_1&=\left\{ a,b \in {\mathbb {F}}_{\ell }^{*} \mid \,\mathrm{ord}\,{(}a)>\ell ^{\varepsilon }, \,\mathrm{ord}\,{(}b)>\ell ^{\varepsilon }, \,\mathrm{ord}\,{(}ab^{-1})>\ell ^{\varepsilon }\right\} ,\\ S_2&=\left\{ \lambda \in {\mathbb {F}}_{\ell ^2}^{*} \setminus {\mathbb {F}}_{\ell }^{*} \mid \,\mathrm{ord}\,{(}\lambda ) =\,\mathrm{ord}\,{(}\lambda ^{\ell })>\ell ^{\varepsilon }, \,\mathrm{ord}\,{(}\lambda ^{\ell -1}) > \ell ^{\varepsilon }\right\} , \end{aligned}$$

and realize that \(|C|=\frac{1}{2}((\ell +1)\ell |S_1| +\ell (\ell -1)|S_2|).\) This reduced to the problem of estimating \(S_1\) and \(S_2.\) Let us first estimate \(S_1.\) Take \(\sigma \) to be a generator of \({\mathbb {F}}_{\ell }^{*}\). For any divisor d of \(\ell -1,\) the set of all elements of \({\mathbb {F}}_{\ell }^*\) having order exactly d is of the form \(\sigma ^{\frac{\ell -1}{d}i}\) with \((i,d)=1.\) In particular, the number of elements of \({\mathbb {F}}_{\ell }^*\) with order greater than \(\ell ^{\varepsilon }\) is given by

$$\begin{aligned} \sum _{\begin{array}{c} d\mid \ell -1\\ d>\ell ^\varepsilon \end{array}} \phi (d) =\ell +O\left( \sum _{\begin{array}{c} d\mid \ell -1\\ d<\ell ^\varepsilon \end{array}} \phi (d)\right) =\ell +O\left( \ell ^{\varepsilon }d(\ell -1)\right) =\ell +O_{\varepsilon }\left( \ell ^{2\varepsilon }\right) , \end{aligned}$$

where \(d(\cdot )\) is the divisor function, and here we are using the well known upper bound on divisor function (see [20]) for any prime \(\ell \) large enough. Now note that \(\text {ord}\left( ab^{-1}\right) <\ell ^{\varepsilon }\) implies that \(ab^{-1}\) belongs to a set with only \(\sum _{k\mid \ell -1,k<\ell ^{\varepsilon }} \phi (k)\) many elements. By the argument above, this set has only \(O_{\varepsilon } \left( \ell ^{2\varepsilon }\right) \) many elements. This observation implies that

$$\begin{aligned} \left| \left\{ a,b \in {\mathbb {F}}_{\ell }^{*} \mid \,\mathrm{ord}\,{(}a),\,\mathrm{ord}\,{(}b),or \,\mathrm{ord}\,{(}ab^{-1})<\ell ^{\varepsilon }\right\} \right| =O_{\varepsilon }(\ell ^{2\varepsilon +1}). \end{aligned}$$

In particular, we then have \(|S_1|=\ell ^2+O_{\varepsilon }(\ell ^{2\varepsilon +1}).\)

Let us now estimate \(|S_2|.\) Take \(\tau \) to be a generator of \({\mathbb {F}}_{\ell ^2}^{*},\) then any \(\lambda \in S_2,\) of order d,  is of the form \(\tau ^{\frac{\ell ^2-1}{d}i},\) with \((i,d)=1.\) We also have an order restriction on \(\lambda ^{\ell -1},\) which implies that \(\frac{d}{(d,\ell -1)}>\ell ^{\varepsilon }.\) Hence,

$$\begin{aligned} |S_2|=\sum _{\begin{array}{c} d\mid \ell ^2-1 \\ \frac{d}{(d,\ell -1)}>\ell ^{\varepsilon } \end{array}} \phi (d)=\ell ^2+O\bigg (\sum _{\begin{array}{c} d\mid \ell ^2-1 \\ \frac{d}{(d,\ell -1)}<\ell ^{\varepsilon } \end{array}} \phi (d)\bigg ). \end{aligned}$$

Note that, the condition \(\frac{d}{(d,\ell -1)}<\ell ^{\varepsilon }\) implies that \(d<\ell ^{\varepsilon +1}.\) Therefore,

$$\begin{aligned} \sum _{\begin{array}{c} d\mid \ell ^2-1 \\ \frac{d}{(d,\ell -1)} <\ell ^{\varepsilon } \end{array}} \phi (d) \le \ell ^{\varepsilon +1} d(\ell ^2-1)=O_{\varepsilon }\left( \ell ^{1+3\varepsilon }\right) . \end{aligned}$$

Therefore, the required density is at least

$$\begin{aligned} \frac{1}{2}(\ell -1)\ell \frac{|S_1|}{|\mathrm{GL}_2 \left( {\mathbb {F}}_{\ell }\right) |}+\frac{1}{2}(\ell +1) \ell \frac{|S_2|}{\left| \mathrm{GL}_2\left( {\mathbb {F}}_{\ell }\right) \right| } =1+O_{\varepsilon }\left( \frac{1}{\ell ^{1-3\varepsilon }}\right) . \end{aligned}$$

\(\square \)

5.2 Proof of Theorem 5

Let \(\rho _{f,\ell }:\mathrm{Gal}\left( \overline{{\mathbb {Q}}}/ {\mathbb {Q}}\right) \rightarrow \mathrm{GL}_{2r} \left( {\mathbb {F}}_{\ell }\right) \) be the map defined by

$$\begin{aligned} \sigma \mapsto \left( \begin{array}{cccc} \rho _{f_{1,\ell }}(\sigma ) &{} &{} \\ &{} \rho _{f_{2, \ell }}(\sigma ) &{} &{}\\ &{} &{} \ddots &{}\\ &{} &{} &{} \rho _{f_{r,\ell }}(\sigma )\\ \end{array}\right) . \end{aligned}$$

It is clear that the image of this representation is contained in \(\Delta _r(\ell ),\) where

$$\begin{aligned} \Delta _r(\ell )=\left\{ \left( \begin{array}{cccc} g_1 &{} &{} &{}\\ &{} g_2 &{} &{}\\ &{} &{} \ddots &{} \\ &{} &{} &{} g_r\\ \end{array}\right) \mid \det (g_1)=\det (g_2)=\cdots =\det (g_r)\right\} . \end{aligned}$$

It is in fact the case that the image is contained in \(\Delta _r^{(k-1)}(\ell ),\) where \(\Delta ^{(k-1)}_{r}(\ell )\) denotes the set of matrices in \(\Delta _r(\ell )\) in which determinant of each block is a \({(k-1)}\)th power in \({\mathbb {F}}_{\ell }^{*}.\) Due to [21, Theorem 3.1], we may assume that for any prime \(\ell \) large enough, the image of each \(\rho _{f_{i,\ell }}\) is \(\Delta _1^{(k-1)}(\ell ),\) which coincides with the set of matrices in \(\text {GL}_2({\mathbb {F}}_{\ell })\) whose determinants are a \((k-1,\ell -1)\)th power in \({\mathbb {F}}_{\ell }^{*}.\) If the image of \(\rho _{f,\ell }\) is not exactly \(\Delta _r^{(k-1)}(\ell ),\) then by [19, Lemma 5.1] we get a set of quadratic characters \(\{\chi _{i,j,\ell }\}_{1\le i,j\le r}\) of \(\mathrm{Gal}\left( \overline{{\mathbb {Q}}}/{\mathbb {Q}}\right) \) such that

$$\begin{aligned} \rho _{f_i,\ell }\left( \text {Frob}_p\right) ~\mathrm{is} ~\mathrm{conjugate}~\mathrm{to}~\chi _{i,j,\ell } \left( \text {Frob}_p\right) \rho _{f_j,\ell } \left( \text {Frob}_p\right) ~\text {in}~\mathrm{GL}_2({\mathbb {F}}_{\ell }), \end{aligned}$$

for all \(1 \le i,j\le r.\) In particular, \(a_i(p)=\pm a_j(p) (\mathrm{mod} \,\ell ),\) for all \(1\le i,j\le r,\) and any prime \(p \not \mid N\ell .\) This implies that \(\alpha ^{(i,p)}_{\ell } +\beta ^{(i,p)}_{\ell } =\pm (\alpha ^{(j,p)}_{\ell } +\beta ^{(j,p)}_{\ell }).\) Moreover, we also know that

$$\begin{aligned} \alpha ^{(i,p)}_{\ell }\beta ^{(i,p)}_{\ell } =\alpha ^{(j,p)}_{\ell }\beta ^{(j,p)}_{\ell }=p^{k-1} \,(\mathrm{mod}\,\ell ). \end{aligned}$$

In particular, this means that

$$\begin{aligned} \{\alpha ^{(i,p)}_{\ell },\beta ^{(i,p)}_{\ell }\} =\pm \{\alpha ^{(j,p)}_{\ell },\beta ^{(j,p)}_{\ell }\}, \forall 1\le i,j\le r, \text {and for any prime}~p \not \mid N\ell . \end{aligned}$$
(39)

Due to GST, for a positive density of primes p,  none of these

$$\begin{aligned} \{\alpha ^{(i,p)}\beta ^{-(j,p)}\}_{1\le i,j\le 2} \quad \mathrm{{or}}\quad \pm \{\alpha ^{(i,p)}, \alpha ^{-(j,p)}\}_{1\le i\ne j\le 2} \end{aligned}$$

are roots of unity. For those primes p, following the arguments in the proof of Lemma 10, and considering the set in (34), each element of the set \(\{\alpha ^{(i,p)}_{\ell } \beta ^{-(j,p)}_{\ell }\}_{1\le i,j\le 2}\) has order larger than 4 except for finitely many primes \(\ell .\) We then have a contradiction to (39), and hence we may assume that the image of \(\rho _{f,\ell }\) is indeed \(\Delta _r^{(k-1)}(\ell )\) for any prime \(\ell \) large enough.

Hence, the required density is at least \(\frac{|C_r^{k-1}(\ell )|}{|\Delta _r^{(k-1)}(\ell )|},\) where \(C^{k-1}_r(\ell )\) is the union of conjugacy classes of elements in \(\Delta _r^{(k-1)}(\ell )\) whose eigenvalues satisfy the conditions of Theorem 1. Note that any tuple \(\left( a_1,a_2,\cdots , a_{2r}\right) \in ({\mathbb {F}}_{\ell }^{*})^{2r}\) with \(\,\mathrm{ord}\,{(}a_i)>\ell ^{\varepsilon },\,\mathrm{ord}\,{(}a_ia_j^{-1})>\ell ^{\varepsilon },\forall i\ne j\) and \(a_ia_{i+1}=a_ja_{j+1},\forall i,j~\text {odd}\), satisfies that \(\prod _{i,~\mathrm{odd}} C_{a_i,a_{i+1}} \subseteq C_r^{k-1}(\ell ).\) We call these tuples \(\textit{nice}\) and we want to count them. First of all note that,

$$\begin{aligned} \{\left( a_1,a_2,\cdots , a_{2r}\right) \in ({\mathbb {F}}_{\ell }^{*})^{2r} \mid a_i a_{i+1}=a_j a_{j+1},\forall i,j~\mathrm{odd}\} =\frac{(\ell -1)^{r+1}}{(\ell -1,k-1)}. \end{aligned}$$

On the other hand, for any \((k-1)\)th power \(\lambda \) in \({\mathbb {F}}_{\ell }^{*},\) note that \(ab=\lambda \) and \(\,\mathrm{ord}\,{(}ab^{-1})<\ell ^{\varepsilon }\) imply \(\,\mathrm{ord}\,{(}a^2\lambda ^{-1})<\ell ^{\varepsilon }.\) From the proof of Theorem 4, for a fixed \(\lambda \), the number of such a is \(O_{\varepsilon }(\ell ^{2\varepsilon }).\) Moreover, \(\,\mathrm{ord}\,{(}a)<\ell ^{\varepsilon }\) or \(\,\mathrm{ord}\,{(}b)<\ell ^{\varepsilon }\) holds for only \(O_{\varepsilon }(\ell ^{2\varepsilon })\) many elements a or b. In particular, the number of tuples that does not come into our consideration is

$$\begin{aligned} \sum _{\lambda ,~(k-1) \mathrm{{th}}~\mathrm{power}} O_{\varepsilon } (\ell ^{r-1+2\varepsilon })=O_{\varepsilon } \left( \frac{\ell ^{r+2\varepsilon }}{(k-1,\ell -1)}\right) . \end{aligned}$$

In particular, we then have

$$\begin{aligned} |C_r^{k-1}(\ell )|&\ge \sum _{(a_1,a_2,\cdots , a_r) ~\mathrm{nice}} \left( \prod _{i~\mathrm{odd}}| C_{a_i,a_{i+1}}|\right) \nonumber \\&= \left( \frac{\ell (\ell +1)}{2}\right) ^r \left( \frac{(\ell -1)^{r+1}}{(\ell -1,k-1)} +O_{\varepsilon }\left( \frac{\ell ^{r+2\varepsilon }}{(k-1,\ell -1)}\right) \right) . \end{aligned}$$
(40)

The extra factor \(\left( \frac{\ell (\ell +1)}{2}\right) ^r\) is coming because each conjugacy class \(C_{a_{i,i+1}}\) has \(\ell (\ell +1)\) many elements and taking into consideration that \(C_{a_i,a_{i+1}} =C_{a_{i+1},a_i},\forall i~\text {odd},\) the extra factor \(\frac{1}{2}\) is coming for each component. The proof is now complete because \(|\Delta _r^{(k-1)}(\ell )| =\left( \frac{|\mathrm{GL}_2({\mathbb {F}}_{\ell })|}{\ell -1} \right) ^r\frac{\ell -1}{(\ell -1,k-1)}\). \(\square \)

6 Impact on Waring-type problems

In the present section we combine Theorem 1 with classical analytical tools to prove that a linear recurrence sequence \(\{s_n\}\) is an additive basis over prime fields, under some assumptions. Moreover, we discuss about the advantages of nontrivial exponential sums obtained in Theorem 1 to prove it.

6.1 Waring-type problems with linear recurrence sequences

Let \(\{s_n\}\) be a nonzero linear recurrence sequence modulo \(\ell \) as in (2) with order r,  period \(\tau \) and \((a_0,\ell )=1\). Given an integer \(k\ge 2,\) for any residue class \(\lambda (\mathrm{mod}\,\ell )\), we denote by \(T_k(\lambda )\) the number of solutions of the congruence

$$\begin{aligned} s_{n_1} + \cdots +s_{n_k} \equiv \lambda \,(\mathrm{mod}\,\ell ), \quad \mathrm{with} \quad 1\le n_1, \ldots , n_k \le \tau . \end{aligned}$$

Then, writing \(T_k(\lambda )\) in terms of exponential sums, we get

$$\begin{aligned} T_k(\lambda )=\frac{1}{\ell }\sum _{\xi =0}^{\ell -1} \sum _{n_1 \le \tau } \cdots \sum _{n_k \le \tau } {\mathbf {e}}_{\ell }\left( {\xi (s_{n_1} + \cdots +s_{n_k} - \lambda )}\right) . \end{aligned}$$

Taking away the term \(\xi =0\) and using triangle inequality, it is clear that

$$\begin{aligned} \left| T_k(\lambda ) - \frac{\tau ^k}{\ell }\right|&= \frac{1}{\ell }\left| \sum _{\xi =1}^{\ell -1} \sum _{n_1 \le \tau } \cdots \sum _{n_k \le \tau } {\mathbf {e}}_{\ell }\left( {\xi (s_{n_1} +\cdots +s_{n_k} - \lambda )}\right) \right| \nonumber \\&\le \frac{1}{\ell }\sum _{\xi =1}^{\ell -1} \left| \sum _{n_1 \le \tau } \cdots \sum _{n_k \le \tau } {\mathbf {e}}_{\ell }\left( {\xi (s_{n_1} + \cdots +s_{n_k})}\right) \right| \nonumber \\&\le \frac{1}{\ell }\sum _{\xi =1}^{\ell -1} \left( \left| \sum _{n_1 \le \tau } {\mathbf {e}}_{\ell }\left( {\xi s_{n_1}}\right) \right| \cdots \left| \sum _{n_k \le \tau } {\mathbf {e}}_p\left( {\xi s_{n_k}}\right) \right| \right) \nonumber \\&\le \left( \max _{\xi \in {\mathbb {F}}_{\ell }^*}\left| \sum _{n \le \tau } {\mathbf {e}}_{\ell }\left( {\xi s_{n}}\right) \right| \right) ^k\,. \end{aligned}$$
(41)

Assume that we have an exponential sum bound of the type

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n \le \tau } {\mathbf {e}}_{\ell }\left( {\xi s_n}\right) \right| \le R\,. \end{aligned}$$
(42)

Then, combining (41) and (42) we get \(\left| T_k(\lambda )-\frac{\tau ^k}{\ell }\right| \le R^k.\) Now, if \((R/\tau )^k \ell \) goes to zero as \(\ell \rightarrow \infty \), we obtain an effective asymptotic formula for \(T_k(\lambda ).\) In particular, \(T_k(\lambda ) >0\) for \(\ell \) large enough. For instance, if \(\tau \ge \ell ^{r/2 + \varepsilon }\) we employ Korobov’s bound (3) with \(R=\ell ^{r/2}\) to get

$$\begin{aligned} \left| T_k(\lambda )-\frac{\tau ^k}{\ell }\right| \le \frac{\tau ^k}{\ell }\left( ({\ell ^{r/2}}/{\tau })^{k}\ell \right) \le \frac{\tau ^k}{\ell } \left( {\ell ^{1-k\varepsilon }}\right) , \end{aligned}$$

therefore \(T_k(\lambda )=\tfrac{\tau ^k}{\ell }(1 + o(1))\) for \(k > 1/ \varepsilon \) in the range \(\tau \ge \ell ^{r/2 + \varepsilon }.\) If the characteristic polynomial \(\omega (x)\) of \(\{s_n\}\) is irreducible with \(\deg (\omega )\ge 2\) and the least period \(\tau \) satisfies \(\gcd (\tau , \ell ^d -1) < \tau \ell ^{-\varepsilon }\) for any divisor \(d<r\) of r,  then by Corollary 6 we choose \(R=\tau \ell ^{-\delta }\) for some positive \(\delta =\delta (\varepsilon ),\) to get

$$\begin{aligned} \left| T_k(\lambda )-\frac{\tau ^k}{\ell }\right| \le \frac{\tau ^k}{\ell } \left( ({\tau \ell ^{-\delta }}/{\tau })^{k} \ell \right) =\frac{\tau ^k}{\ell } \left( {\ell ^{1- k\delta }}\right) . \end{aligned}$$

Thus, \(T_k(\lambda )>0\) when \(k > 1/\delta \) and \(\max _{\begin{array}{c} d<r \\ d|r \end{array}}\gcd (\tau , \ell ^d-1)< \tau \ell ^{-\varepsilon }.\) Let us summarize the above discussion in the form of following corollary.

Corollary 12

Let \(\ell \) be a prime number, \(k > 0\) be any integer, \(\varepsilon >0\), and \(\{s_n\}\) be a linear recurrence sequence of order \(r\ge 2\) in \({\mathbb {F}}_{\ell }.\) If the characteristic polynomial \(\omega (x)\) in \({\mathbb {F}}_{\ell }[x]\) is irreducible with \((\omega (0),\ell )=1,\) the least period \(\tau \) satisfies

$$\begin{aligned} \max _{\begin{array}{c} d<r\\ d | r \end{array}} (\tau , \ell ^d -1 ) < \tau \ell ^{-\varepsilon }, \end{aligned}$$

and for every integer \(\lambda \), let \(T_k(\lambda )\) denote the number of solutions of the congruence

$$\begin{aligned} s_{n_1} + \cdots +s_{n_k} \equiv \lambda \,(\mathrm{mod}\,\ell ), \quad \mathrm{with} \quad 1\le n_1, \ldots , n_k \le \tau , \end{aligned}$$

then there exists an integer \( k_0>0\) such that for any \(k \ge k_0\), \(T_k(\lambda )= \tfrac{\tau ^k}{\ell }(1 + o(1)).\)

We are now ready to prove the main result of this section.

Theorem 13

Let \(\{s_n\}\) be a linear recurrence sequence in \({\mathbb {Z}},\) whose characteristic polynomial \(\omega (x) \in {\mathbb {Z}}[x]\) is monic, irreducible, and having prime degree. Then for a set of primes \(\ell \) with positive density, the sequence \(\{s_n\}\) is an additive basis modulo \(\ell .\) More precisely, there exists an absolute constant c such that the Waring-type congruence

$$\begin{aligned} s_{n_1}+\cdots + s_{n_c} \equiv \lambda \,(\mathrm{mod}\,\ell ) \end{aligned}$$

is solvable for any residue class \(\lambda \,(\mathrm{mod}\,\ell )\).

Proof

Let \({\mathbb {Q}}_{\omega }\) denote the splitting field of \(\omega \) and \(G_{\omega }\) be \(\text {Gal}\left( {\mathbb {Q}}_{\omega }/ {\mathbb {Q}}\right) \). Note that \(\deg (\omega )\) divides \(|G_{\omega }|\) and \(G_{\omega }\) is contained in the symmetric group \(S_{\deg (\omega )}.\) By the Cauchy’s theorem, there exists an element in \(G_{\omega }\) of order \(\deg (\omega ).\) In particular, there is a \(\deg (\omega )\)-cycle in \(G_{\omega }\) because \(\deg (\omega )\) is prime. By Chebotarev’s density theorem, the set of such primes \(\ell \) for which \(\omega (x)\,(\mathrm{mod}\,\ell )\) is irreducible, have positive density, see Theorem of Frobenius in [26, Page 11]. We are now interested to work with these primes.

Let \(\alpha \) be a root of \(\omega (x) (\mathrm{mod}\,\ell ),\) and \(\tau \) be the period of sequence \(\{s_n\}(\mathrm{mod}\,\ell )\). We then have \(\tau =\,\mathrm{ord}\,{(}\alpha ).\) Since \(\omega (x)(\mathrm{mod}\,\ell )\) is irreducible, one can write

$$\begin{aligned} \omega (x)(\mathrm{mod}\,\ell ) =\prod _{i=0}^{\deg (\omega )-1} (x-\alpha ^{\ell ^i})\,, \end{aligned}$$

and in particular, \(\omega (0)(\mathrm{mod}\,\ell ) =(-\alpha )^{1+\ell +\ell ^2+\cdots +\ell ^{\deg (\omega )-1}}.\) Note that \((\omega (0),\ell )=1,\) for all but finitely many primes \(\ell \). We now need to verify the condition of Corollary 12 for \(d=1\) because \(\deg (\omega )\) is prime. Observe that \(\gcd (\mathrm{ord}~\alpha ,\ell -1)=\frac{\mathrm{ord} ~\alpha }{\mathrm{ord}~\alpha ^{\ell -1}}.\) Fix any \(0<\varepsilon <1/2,\) and now the proof is complete if \(\mathrm{ord}\left( \alpha ^{\ell -1}\right) >\ell ^{\varepsilon }\) holds for almost all primes \(\ell .\)

For any integer t,  we have the following

$$\begin{aligned} \alpha ^{(\ell -1)t}=1 \implies \alpha ^{rt} =\left( \prod _{i=0}^{r-1} \alpha ^{\ell ^i}\right) ^{t} \implies \alpha ^{2rt}=\omega (0)^{2t}. \end{aligned}$$

In particular, \(\alpha \) is a root of both \(\omega (x)(\mathrm{mod}\,\ell )\) and \(\prod _{t\le T}\left( x^{2rt}-\omega (0)^{2t}\right) (\mathrm{mod}\,\ell ).\)

Now, given a large positive parameter T, we consider the resultant

$$\begin{aligned} R(T)=\text {Res}\left( \omega (x), \prod _{t\le T} \left( x^{2rt}-\omega (0)^{2t}\right) \right) . \end{aligned}$$

Counting the number of distinct prime factors of the resultant as in the proof of Lemma 7, we see that \( |\{\ell ~\mathrm{prime} \mid \,\mathrm{ord}\,{(}{\alpha ^{\ell -1}})\le T\}|=O(T^2).\) For any large \(y>0,\) taking \(T=y^{\varepsilon },\) we see that there exists a \(\delta \) such that

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi s_n }\right) \right| \le \tau \ell ^{-\delta } \end{aligned}$$

holds, for at least \(c_{\omega }\pi (y)+O(y^{2\varepsilon })\) many primes \(\ell \le y,\) for some constant (which depends only on \(\omega \)) \(c_{\omega }>0.\) Now, the proof follows immediately from Corollary 12. \(\square \)

For further explanation, one can consider the following example.

Example 14

Consider the classical case of Fibonacci sequence \(\{F_n\}.\) In the beginning of this section, the result of the third author is discussed for this special case. We can however get a slightly weaker result from Corollary 12. In this case, the characteristic polynomial is \(x^2-x-1.\) It is of course a monic, irreducible and of a prime degree. This polynomial is irreducible modulo prime \(\ell ,\) iff we have the Legendre symbol \(\left( \frac{5}{\ell }\right) =-1.\) The set of such primes have density 1/2. Corollary 12 says, for almost all of these primes, \(\{F_n\}\) is an additive basis modulo \(\ell .\) For the other set of primes, we use Lemma 7. Given any \(0< \varepsilon < 1/2,\) for \(\pi (y) + O(y^{2\varepsilon })\) many primes \(\ell \le y,\) we have

$$\begin{aligned} \,\mathrm{ord}\,{\alpha _{\ell }}> \ell ^{\varepsilon }, \qquad \,\mathrm{ord}\,{\beta _{\ell }}> \ell ^{\varepsilon } \quad \mathrm{and} \quad \,\mathrm{ord}\,{(\alpha _{\ell } \beta _{\ell }^{-1}})> \ell ^{\varepsilon }, \end{aligned}$$

where \(\alpha _{\ell }\) and \(\beta _{\ell }\) are the roots of \(x^2-x-1 (\mathrm{mod}\,\ell ).\) It then follows from [2, Corollary, page 479] that there exists a \(\delta =\delta (\varepsilon )>0\) such that

$$\begin{aligned} \max _{\begin{array}{c} (c,d)\in {\mathbb {F}}_{\ell } \times {\mathbb {F}}_{\ell } \\ (c,d)\ne (0,0) \end{array}} \left| \sum _{{ n \le \ell -1}} {\mathbf {e}}_{\ell }\left( {c \alpha ^n + d \beta ^n }\right) \right| \le \ell ^{1-\delta }. \end{aligned}$$

In particular, we then have

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi F_n }\right) \right| \le \tau \ell ^{-\delta }, \end{aligned}$$

which guarantees the existence of an absolute constant, as we saw in the proof of Theorem 13. With this, we have an inexplicit result for the Fibonacci sequences compared to what the third author had in [11]. However, Theorem 13 provides a general result for a large class of linear recurrence sequences.

6.2 Waring-type problems for modular forms

Let us recall our discussion from the introduction about Waring problem for modular forms. In this section, we are assuming that the modular form is a newform without CM. Fix any \(0<\varepsilon <\frac{1}{2},\) say \(\varepsilon =\frac{1}{3}.\) Then taking \(\delta :=\delta (\varepsilon )\) as in Theorem 2, the following estimate

$$\begin{aligned} \max _{\xi \in {\mathbb {F}}_{\ell }^*} \left| \sum _{n\le \tau } {\mathbf {e}}_{\ell }\left( {\xi a(p^n) }\right) \right| \le \tau \ell ^{-\delta }, \end{aligned}$$

holds for almost all primes p and \(\ell .\) The discussion in Sect. 6.1 shows that \(T_s(\lambda )>0\) for any \(\lambda \in {\mathbb {F}}_{\ell },\) and \(s>1/\delta ,\) where \(T_s(\lambda )\) is the number of solutions of the congruence

$$\begin{aligned} a(p^{n_1}) + \cdots +a(p^{n_s}) \equiv \lambda \,(\mathrm{mod}\,\ell ), \quad \mathrm{with} \quad 1\le n_1, \ldots , n_s \le \tau . \end{aligned}$$

Moreover, this s does not depend on the choice of the eigenform because \(\delta \) does not. More precisely, we have the following result.

Corollary 15

Let f be a newform without CM and with rational Fourier coefficients. We say, a proposition \({\mathcal {Q}}_{f}(p,\ell ,s)\) is true if and only if, any element of \({\mathbb {F}}_{\ell }\) can be written as a sum of at most s elements of the set \(\{a(p^n)\}_{n\ge 0}.\) Then, there is an absolute constant \(s_0\) such that \({\mathcal {Q}}_{f}(p,\ell ,s_0)\) is true for almost all primes p and \(\ell \). Moreover, \(s_0\) does not depend on the choice of f.

As an immediate consequence of Theorem 4, we obtain the following result.

Corollary 16

Suppose the newform is without CM and with integer Fourier coefficients. Then there exists an absolute constant \(s_0\) such that, for any large prime \(\ell \) satisfying the coprimality condition \((\ell -1,k-1)=1,\) the proposition \({\mathcal {Q}}_{f}(p,\ell ,s_0)\) is true for a set of primes p with density at least \(1+O\left( \frac{1}{\sqrt{\ell }}\right) .\) Moreover, \(s_0\) does not depend on the choice of f.

6.3 Bound of non-linearity of a linear recurrence sequence

Let \(\{s_n\}\) be a linear recurrence sequence modulo \(\ell \) as in (2) with order r\((a_0,\ell )=1\) and period \(\tau \). For \(0 \le b \le \ell ^r-1 \), let us define the sum

$$\begin{aligned} W(b)= \sum _{n \le \tau } {\mathbf {e}}_{\ell }\left( {s_n + { \left\langle {b,n}\right\rangle }}\right) , \end{aligned}$$

where \(\left\langle {b,n}\right\rangle \) denotes the inner product \(\left\langle {b,n}\right\rangle =b_0 n_0 + \cdots + b_{r-1}n_{r-1}\) assuming that \(0\le b,n\le \ell ^r-1\) are written in its \(\ell \)–ary expansion

$$\begin{aligned} b=b_0 + b_1 \ell + \cdots + b_{r-1}\ell ^{r-1}, \qquad n=n_0 + n_1 \ell + \cdots + n_{r-1}\ell ^{r-1}. \end{aligned}$$

Bounds for W(b) have cryptographic significance, see [25] and references therein. Shparlinski and Winterhof [25, Theorem 1] proved that

$$\begin{aligned} \max _{0 \le b \le \ell ^r-1} |W(b)| \ll \tau ^{3/4} r^{1/4} \ell ^{r/8}, \end{aligned}$$

whenever the characteristic polynomial of \(\{s_n\}\) is irreducible. Such bound is asymptotically effective if \(r\ell ^{r/2}/\tau \rightarrow 0.\) Combining Corollary 6 and the ideas of [25], we are able to improve such bound for a large class of linear recurrence sequences in the range \(\tau > \ell ^{\varepsilon }.\) For example, assuming hypothesis of Corollary 6, if r is fixed then \(|W(b)|\ll \tau \ell ^{-\delta '}\) as \(\ell \rightarrow \infty \) for some \(\delta '>0.\) In general, we get \(|W(b)|=o(\tau )\) if \(r \log \ell / \ell ^{\delta '} \rightarrow 0\) as \(\ell \rightarrow \infty .\) More precisely,

Corollary 17

Let \(\ell \) be a prime number, \(\varepsilon >0\) and \(\{s_n\}\) be a linear recurrence sequence of order \(r\ge 1.\) If the characteristic polynomial f(x) in \({\mathbb {F}}_{\ell }[x]\) is irreducible polynomial with \((f(0),\ell )=1,\) and the least period \(\tau \) satisfies

$$\begin{aligned} \tau > \ell ^{\varepsilon }, \quad \mathrm{and} \quad \max _{\begin{array}{c} d<r \\ d | r \end{array}} (\tau , \ell ^d -1) < \tau \ell ^{-\varepsilon }, \end{aligned}$$

then there exists a \(\delta =\delta (\varepsilon )>0\) such that

$$\begin{aligned} \max _{0 \le b \le \ell ^r-1} \left| \sum _{n \le \tau } {\mathbf {e}}_{\ell }\left( {s_n + { \left\langle {b,n}\right\rangle }}\right) \right| \le \tau \ell ^{-\delta /4} (r \log \ell )^{1/4}\left( 1 + \ell ^{-\delta /4} (r \log \ell )^{1/4} \right) . \end{aligned}$$

Proof

The proof follows the same steps as given in [25, Theorem 1]. We just need to employ the bound given by Corollary 6 instead of Korobov’s bound. \(\square \)

Note. We have an improvement on the bound [25, Theorem 1] , if \(\tau \le \frac{\ell ^{r/2+\delta }}{\log \ell }.\) Clearly there are many such cases, for instance, one can consider any element in \({\mathbb {F}}_{\ell }^{*}\) of order smaller than \(\ell ^{\frac{1}{2}}\).