On a Family of Sequences Related to Chebyshev Polynomials

Andrew N. W. Hone^{1} School of Mathematics, Statistics & Actuarial Science Sibson Building University of Kent Canterbury CT2 7FS UK

                         anwh@kent.ac.uk

L. Edson Jeffery 11918 Vance Jackson Road San Antonio, TX 78230 USA

                       lejeffery2@gmail.com

Robert G. Selcoe 16214 Madewood Street Cypress, TX 77429 USA

                        rselcoe@gmail.com

Abstract

We consider the appearance of primes in a family of linear recurrence sequences labelled by a positive integer n. The terms of each sequence correspond to a particular class of Lehmer numbers, or (viewing them as polynomials in n) dilated versions of the so-called Chebyshev polynomials of the fourth kind, also known as airfoil polynomials. We prove that when the value of n is given by a dilated Chebyshev polynomial of the first kind evaluated at a suitable integer, either the sequence contains a single prime, or no term is prime. For all other values of n, we conjecture that the sequence contains infinitely many primes, whose distribution has analogous properties to the distribution of Mersenne primes among the Mersenne numbers. Similar results are obtained for the sequences associated with negative integers n, which correspond to Chebyshev polynomials of the third kind, and to another family of Lehmer numbers.

1Corresponding author. Currently on leave in the School of Mathematics and Statistics, University of New South Wales, Sydney NSW 2052, Australia.

1 Introduction

Consider the linear recurrence of second order given by

s_{k+2} − n s_{k+1} + s_{k} = 0,  (1)

together with the initial conditions

s_{0} = 1,  s_{1} = n + 1.  (2)

For each integer n, this generates an integer sequence that begins

\begin{matrix}1, n + 1, n^{2} + n − 1, n^{3} + n^{2} − 2n − 1, n^{4} + n^{3} − 3n^{2} − 2n + 1, \\ n^{5} + n^{4} − 4n^{3} − 3n^{2} + 3n + 1, …. \end{matrix}  (3)

The sequence can also be extended backwards to negative indices k, so that in particular s_{−1} = −1 = −s_{0}, which implies that it has the symmetry

s_{k}(n) = −s_{−k−1}(n)  (4)

for all k. In this way we obtain a sequence that we denote by ( s_{k}(n) )_{k∈ℤ}, where the argument denotes the dependence on n.

We can also interpret this as a sequence of polynomials in the variable n, with the integer sequences being obtained by substituting particular values for the argument. From this point of view, it is apparent from the recursive definition that, for each k ≥ 0, s_{k}(n) is a monic polynomial of degree k in n with integer coefficients. In fact, these are rescaled (or dilated) versions of polynomials that are used to determine the pressure distribution in linear airfoil theory, being given by

s_{k}(n) = W_{k}(n/2),  W_{k}(cos θ) = \frac{sin ((2k + 1)θ/2)}{sin(θ/2)},  (5)

where W_{k} are known as the Chebyshev polynomials of the fourth kind [18], or the airfoil polynomials of the second kind (see [5], where the notation u_{k} is used in place of W_{k}). As a function of θ, the expression on the far right-hand side of (5) is known as the Dirichlet kernel in Fourier analysis, where it is usually denoted D_{k}(θ) [8]. Compared with those of the third and fourth kinds, the properties of Chebyshev polynomials of the first and second kinds are much better known, and in what follows we will make extensive use of connections with the latter two sets of polynomials.

The primary goal of this article is to describe the case where n is a positive integer, but before proceeding, we consider the sequences obtained for some particular small values of |n| ≤ 2, which will mostly be excluded from subsequent analysis, but are relevant nevertheless. In the case n = 0, the sequence ( s_{k}(0) ) begins

1, 1, −1, −1, …,  (6)

and repeats with period 4; we mention this case because it is equivalent to the sequence ( s_{k}(n) mod n). When n = 1 the sequence has period 6, being specified by the six initial terms

1, 2, 1, −1, −2, −1, …,  (7)

and for n = −1 the sequence repeats the values

1, 0, −1  (8)

with period 3. For n = 2 the sequence grows linearly with k, beginning with

1, 3, 5, 7, 9, 11, …,  (9)

and consists of the odd integers, that is

s_{k}(2) = 2k + 1,  (10)

while for n = −2 the sequence has period 2, being given by

s_{k}(−2) = (−1)^{k}.  (11)

For each integer n ≥ 3 the sequence increases monotonically for k ≥ 0 and grows exponentially with k (see below for details).

Sequence \underline{A269254} in the Online Encyclopedia of Integer Sequences (OEIS) [27] records the first appearance of a prime term in ( s_{k}(n) ).

Definition 1. (Sequence \underline{A269254}.) For each integer n ≥ 1, if the sequence of terms ( s_{k}(n) )_{k≥0} with non-negative indices contains a prime, then let a_{n} be the smallest value of k ≥ 1 such that s_{k}(n) is prime; or otherwise, if there is no such term, let a_{n} = −1.

There is also sequence \underline{A269253}, whose nth term is given by the first prime to appear in ( s_{k}(n) )_{k≥0}, or by −1 if no prime appears.

To illustrate the above definition, let us start with n = 1: since the first prime term in the sequence (7) is s_{1}(1) = 2, it follows that a_{1} = 1. Similarly, for n = 2, the first prime in (9) is s_{1}(2) = 3, so a_{2} = 1; but for n = 3, the sequence ( s_{k}(3) ) begins 1, 4, 11, …, so a_{3} = 2. In cases where a prime term has appeared in the sequence ( s_{k}(n) ), the value of a_{n} is immediately determined. The sequence (a_{n})_{n≥1} begins with the following terms for 1 ≤ n ≤ 34 :

\begin{matrix}1, 1, 2, 1, 2, 1, −1, 2, 2, 1, 2, 1, 2, −1, 2, 1, 3, 1, 2, 2, 2, 1, −1, 2, 6, 2, 3, 1, \\ 3, 1, 2, 9, 9, −1, …. \end{matrix}  (12)

All of the positive values above can be checked very rapidly, and it turns out that all values of a_{n} > 0 are of the form (p − 1)/2, where p is an odd prime: this is a direct consequence of Lemma 26 below. What is less easy to verify is the negative values a_{7} = a_{14} = a_{23} = a_{34} = −1 displayed above, indicating no primes. For instance, when n = 7, the sequence ( s_{k}(7) ) begins with

1, 8, 55, 377, 2584, 17711, 121393, 832040, 5702887, …,  (13)

and it can be verified that none of these first few terms are prime; but to show that a_{7} = −1 it is necessary to prove that s_{k}(7) is composite for all k > 0: a proof of this fact can be found in section 3, while another proof appears in section 5 in a broader setting.

In fact, in order to understand the family of sequences ( s_{k}(n) ) with positive n, it will be natural to consider negative integer values of n as well. In that case, it is helpful to define the family of sequences ( r_{k}(n) ) given by

r_{k}(n) = (−1)^{k} s_{k}(−n).  (14)

It is straightforward to show by induction that, for fixed n, the sequence ( r_{k}(n) ) satisfies the same recurrence (1) but with different initial conditions, namely

r_{k+2} − n r_{k+1} + r_{k} = 0,

together with

r_{0} = 1,  r_{1} = n − 1.  (15)

For integer n, this generates an integer sequence that begins

\begin{matrix}1, n − 1, n^{2} − n − 1, n^{3} − n^{2} − 2n + 1, n^{4} − n^{3} − 3n^{2} + 2n + 1, \\ n^{5} − n^{4} − 4n^{3} + 3n^{2} + 3n − 1, …. \end{matrix}  (16)

Up to rescaling n by a factor of 2, this sequence of polynomials arises in describing the downwash distribution in linear airfoil theory, and in this context they are referred to as the airfoil polynomials of the first kind [5], denoted t_{k}; with the alternative notation V_{k} they are also referred to as the Chebyshev polynomials of the third kind [18], so that

r_{k}(n) = V_{k}(n/2),  V_{k}(cos θ) = \frac{cos ((2k + 1)θ/2)}{cos(θ/2)}.  (17)

Since n = 2 cos θ, the identity (14) can also be obtained immediately by taking θ → θ + π in (5), and comparing with (17).

There is another OEIS sequence that is relevant here, corresponding to the first appearance of a prime in the sequence defined by (14) for each positive integer n.

Definition 2. (Sequence \underline{A269252}.) For each integer n ≥ 1, if the sequence of terms ( r_{k}(n) )_{k≥0} with non-negative indices contains a prime, then let ã_{n} be the smallest value of k ≥ 1 such that r_{k}(n) is prime; or otherwise, if there is no such term, let ã_{n} = −1.

There is also sequence \underline{A269251}, whose nth term is given by the first prime to appear in ( r_{k}(n) )_{k≥0}, or by −1 if no prime appears.

For comparison with \underline{A269254}, note that the first few terms of \underline{A269252} for 1 ≤ n ≤ 34 are given by

\begin{matrix}−1, −1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 3, 2, 2, 1, 14, 1, 2, 2, 3, 1, 2, 5, 2, 36, \\ 2, 1, 2, 1, 15, −1, …. \end{matrix}  (18)

The two initial −1 values that appear above for n = 1, 2 clearly correspond to (8) and (11), respectively, while the first non-trivial case to consider is the value −1 that appears for n = 34, corresponding to the sequence ( r_{k}(34) ), which begins with

1, 33, 1121, 38081, 1293633, 43945441, 1492851361, 50713000833, …;  (19)

again it can be verified that none of these first few terms are prime, while a proof that all terms with k > 0 are composite for this and certain other values of n is given in section 5.

Aside from the connection with Chebyshev polynomials, the numbers s_{k}(n) and r_{k}(n) also correspond to particular instances of Lehmer numbers with odd index, which are closely related to sequences of Lucas numbers. Prime divisors in sequences of Lucas and Lehmer numbers have been studied for some time; see e.g., [1, 25, 26, 29] for some general results, or see [10] for a more elementary introduction to primitive divisors. However, to the best of our knowledge, the question of when such sequences are without prime terms, or of where the first prime appears in such sequences, has not been considered in detail before, except in the case n = 6.

The case n = 6 corresponds to the so-called NSW numbers, named after [19] (sequence \underline{A002315}). An NSW number q can be characterized by there being some r such that the pair of positive integers (q, r) satisfies the Diophantine equation

q^{2} + 1 = 2r^{2}.

The sequence of NSW numbers is given by q = s_{k}(6) for k ≥ 0, with the corresponding solution to the above equation being (q, r) = (s_{k}(6), r_{k}(6)). The subsequence of prime NSW numbers is of particular interest in relation to finite simple groups of square order: the symplectic group of dimension 4 over the finite field 𝔽_{q} has a square order if and only if q is a prime NSW number, with the order being (q^{2}(q^{2} − 1)r)^{2}. The first prime NSW number is s_{1}(6) = 7, and the symplectic group of dimension 4 over 𝔽_{7} is of order 11760^{2}.

For an arbitrary linear recurrence relation of second order, that is

x_{k+2} = a x_{k+1} + b x_{k}, (a, b) ∈ ℤ^{2},

the general question of whether it generates a sequence without prime terms has been considered for some time. If either the coefficients a, b or the two initial values x_{0}, x_{1} have a common factor then it is obvious that all terms x_{k} for k ≥ 2 have the same common factor, so the main case of interest is where gcd(a, b) = 1 = gcd(x_{0}, x_{1}). In the case of the Fibonacci recurrence with a = b = 1, the groundbreaking result was due to Graham, who found a sequence whose first two terms are relatively prime and which consists only of composite integers [11]. This result was generalized to arbitrary second-order recurrences by Somer [28] and Dubickas et al. [6].

An outline of the paper is as follows. The next section serves to set up notation and provide a rapid introduction to the properties of dilated Chebyshev polynomials of the first and second kinds, which will be used extensively in the sequel, and also contains the required definitions of the corresponding sequences of Lucas and Lehmer numbers that appear subsequently. Section 3 provides a very brief review of some standard facts about linear recurrence sequences and products of such sequences, before a presentation of examples and preliminary results about values of n for which the terms s_{k}(n) factor into a product of two linear recurrence sequences; this serves to illustrate and motivate the results which appear in section 5. As preparation for the latter, section 4 contains a collection of various general properties of the sequences ( s_{k}(n) ). The main results of the paper, on the factorization of ( s_{k}(n) ) and ( r_{k}(n) ) when n is a dilated Chebyshev polynomial of the first kind evaluated at integer argument (Chebyshev values), are presented in section 5. Section 6 considers the appearance of primes in these sequences in the case that n is not one of the Chebyshev values, and gives heuristic arguments and numerical evidence to support a conjecture to the effect that the behaviour is analogous to that of the sequence of Mersenne primes. Some conclusions are made in the final section, and there are two appendices: the first is a collection of data on prime appearances, and the second is a brief catalogue of related sequences in the OEIS.

This paper arose out of a series of posts to the SeqFan mailing list, with contributions from many people, both professional and recreational mathematicians. Our aim throughout has been to make the presentation as explicit as possible, and for the sake of completeness we have stated several standard facts and definitions, as well as providing direct, elementary proofs of almost every statement (even when some of them are particular cases of more general results in the literature). We hope that in this form it will be possible for our work to be appreciated by sequence enthusiasts of every persuasion.

2 Dilated Chebyshev polynomials and Lehmer numbers

The families of Chebyshev polynomials arise in the theory of orthogonal polynomials, and have diverse applications in numerical analysis [18]. There are four such families, and while the Chebyshev polynomials of the first and second kinds are well studied in the literature, those of the third and fourth kinds are not so well known, and some of their connections to arithmetical problems have only been considered quite recently [13].

In order to define scaled versions of the standard Chebsyhev polynomials in terms of trigonometric functions, let

n = 2 cos θ = λ + λ^{−1},

so that we may write

λ = \frac{n + \sqrt{n^{2} − 4}}{2} = e^{iθ},  (20)

where i = \sqrt{−1}. Then the formulae

T_{k}(2 cos θ) = 2 cos(kθ),  U_{k}(2 cos θ) = \frac{sin ((k + 1)θ)}{sin θ}  (21)

define T_{k}, U_{k} as polynomials in n, for all k ∈ ℤ. In [21, Chapter 18] these polynomials are referred to as the dilated Chebyshev polynomials of the first and second kinds, and they are denoted by C_{k}, S_{k} respectively. In standard notation, the classical Chebyshev polynomials of the first and second kinds are written as T_{k} and U_{k}, and their precise relationship with the dilated polynomials used here is as follows:

T_{k}(n) = 2 T_{k} (\frac{n}{2}) , U_{k}(n) = U_{k} (\frac{n}{2}) .

It is straightforward to show from the definitions (21) that the dilated Chebyshev polynomials of the first and second kinds satisfy the same recurrence (1) as the sequence ( s_{k}(n) ), but with different initial values. For example, to verify that the sequence ( U_{k}(n) ) satisfies the recurrence, it is sufficient to note that

U_{k}(n) − n U_{k−1}(n) + U_{k−2}(n) = \frac{sin((k+1)θ)−2 cos θ sin(kθ)+sin((k−1)θ)}{sin θ},  (22)

and then observe that the right-hand side above vanishes as a consequence of the addition formula for sine in the form

sin(θ + ϕ) + sin(θ − ϕ) = 2 sin θ cos ϕ.  (23)

For comparison with other texts, we note that the sequence of dilated first kind polynomials begins thus:

( T_{k}(n) ) :  2, n, n^{2} − 2, n^{3} − 3n, n^{4} − 4n^{2} + 2, n^{5} − 5n^{3} + 5n, ….  (24)

In contrast, the sequence of dilated second kind polynomials begins as

( U_{k}(n) ) :  1, n, n^{2} − 1, n^{3} − 2n, n^{4} − 3n^{2} + 1, n^{5} − 4n^{3} + 3n, ….  (25)

For future reference, we note the standard identities

T_{ab}(n) = T_{a}(T_{b}(n))  (26)

and

U_{ab−1}(n) = U_{a−1}(T_{b}(n)) U_{b−1}(n),  (27)

which follow from the trigonometric definitions above.

In order to get a formula for the coefficients of the polynomials s_{k}(n), we present an explicit expansion for the dilated Chebyshev polynomials of the second kind. Although this can be found elsewhere in the literature (cf. equations (5.74) and (6.129) in [12]), for completeness we present an elementary proof.

Proposition 3. The dilated Chebyshev polynomials of the second kind are given by

U_{k}(n) = \begin{matrix}⌊ & \frac{k}{2} & ⌋ \\ ∑ \\ i=0 \end{matrix}(−1)^{i}\binom{k − i}{i}n^{k−2i}.  (28)

Proof. First note that for k = 0, 1 the sum on the right-hand side of (28) agrees with the initial terms U_{0} = 1, U_{1} = n. Then, upon substituting the sum formula into the recurrence (22) and comparing powers of n, after dividing by (−1)^{i} we see that the coefficient of n^{k−2i} yields the identity

\binom{k − i}{i} − \binom{k − i − 1}{i} − \binom{k − i − 1}{i − 1} = 0

for binomial coefficients. Thus the sequences defined by the left-hand and right-hand sides of (28) satisfy the same recurrence with the same initial conditions, so they must coincide.

For use in what follows, we also define Lehmer numbers. Given a quadratic polynomial in X with roots α, β, that is

X^{2} − \sqrt{R} X + Q = (X − α)(X − β),  Q, R ∈ ℤ,  (29)

where it is assumed that Q, R are coprime and α/β is not a root of unity, there are two associated sequences of Lehmer numbers, which (adapting the notation of [9]) we denote by L_{k}^{−}(\sqrt{R}, Q) and L_{k}^{+}(\sqrt{R}, Q), where

L_{k}^{−}(\sqrt{R}, Q) = \begin{cases}\frac{α^{k}−β^{k}}{α−β} , & if k odd; \\ \frac{α^{k}−β^{k}}{α^{2}−β^{2}} , & if k even, \end{cases}  (30)

and

L_{k}^{+}(\sqrt{R}, Q) = \begin{cases}\frac{α^{k}+β^{k}}{α+β} , & if k odd; \\ α^{k} + β^{k}, & if k even. \end{cases}  (31)

The sequences of Lehmer numbers can be viewed as generalizations of Lucas sequences. Assuming that R is a perfect square, so P = \sqrt{R} ∈ ℤ, the two types of Lucas sequences associated to the quadratic X^{2} − P X + Q = (X − α)(X − β) are given by

ℓ_{k}^{−}(P, Q) = \frac{α^{k} − β^{k}}{α − β} ,  ℓ_{k}^{+}(P, Q) = α^{k} + β^{k};  (32)

the corresponding Lehmer numbers L_{k}^{±}(P, Q) are obtained from the Lucas numbers ℓ_{k}^{±}(P, Q) by removing trivial factors.

From the above definitions, there is a clear link between Chebyshev polynomials and Lucas/Lehmer numbers, which can be summarized in the following

Proposition 4. For integer values n, the sequences of dilated Chebyshev polynomials of the first and second kinds coincide with particular Lucas sequences, that is

T_{k}(n) = ℓ_{k}^{+}(n, 1),  U_{k−1}(n) = ℓ_{k}^{−}(n, 1),  (33)

while the sequences generated by (1) with initial values (15) and (2) consist of Lehmer numbers with odd index, namely

r_{k}(n) = L_{2k+1}^{+} (\sqrt{n + 2}, 1) , s_{k}(n) = L_{2k+1}^{−} (\sqrt{n + 2}, 1)  (34)

respectively, for all k.

Proof. The formulae for T_{k} and U_{k} follow immediately from comparison of (21) with (32), requiring from (20) that α = λ = e^{iθ} = β^{−1} in (29). For the proof of the second part of the statement, note that taking k = 0, 1 gives L_{1}^{−}(\sqrt{n + 2}, 1) = 1 and L_{3}^{−}(\sqrt{n + 2}, 1) = n + 1, while a short calculation shows that L_{2k+1}^{−}(\sqrt{n + 2}, 1) satisfies the same recurrence (1) as s_{k}(n), and similarly for the other sequence given by r_{k}(n) = (−1)^{k}s_{k}(−n); so for each equation in (34), the sequences given by their left/right-hand sides coincide.

Remark 5. There are also expressions for r_{k}(n) and s_{k}(n) in terms of dilated Chebyshev polynomials of the first/second kinds, respectively, with argument \sqrt{n + 2}: see (74) and (53) below.

By writing the roots of the polynomial X^{2} − \sqrt{n + 2} X + 1 as

α^{±1} = \frac{\sqrt{n + 2} ± \sqrt{n − 2}}{2},  (35)

we have an alternative way to identify the terms in sequence \underline{A269254}.

Corollary 6. (Alternative characterization of sequence \underline{A269254}.) For each n ≥ 3, if α is defined by (35), then a_{n} is that positive integer k yielding the smallest prime of the form

\frac{α^{2k+1} − α^{−(2k+1)}}{α − α^{−1}} ,  (36)

or a_{n} = −1 if no such k exists.

The sequence \underline{A269252} can be identified in terms of the characteristic roots of (35) in a similar way.

Corollary 7. (Alternative characterization of sequence \underline{A269252}.) For each n ≥ 3, if α is defined by (35), then ã_{n} is that positive integer k yielding the smallest prime of the form

\frac{α^{2k+1} + α^{−(2k+1)}}{α + α^{−1}} ,  (37)

or ã_{n} = −1 if no such k exists.

3 Some surprising factorizations

In this section we briefly recall some basic facts about sequences generated by linear recurrences, before looking at some special properties of the family of sequences ( s_{k}(n) ). We assume that all recurrences are defined over the field ℂ of complex numbers. (In the next section we will also consider recurrences in finite fields or residue rings.) For a broad review of linear recurrences in a more general setting, the reader is referred to [9].

For what follows, it is convenient to make use of the forward shift, denoted S, which is a linear operator that acts on any sequence (f_{k}) with index k according to

S f_{k} = f_{k+1}.

With this notation, the fact that a sequence (x_{k}) satisfies a linear recurrence relation of order N with constant coefficients can be expressed in the form

F (S) x_{k} = 0,  (38)

where F (of degree N) is the characteristic polynomial of the recurrence.

Definition 8. A decimation of a sequence (x_{k})_{k∈ℤ} is any subsequence of the form (x_{i+dk})_{k∈ℤ}, for some fixed integers i, d, with d ≥ 2. A particular name for the case d = 2 is a bisection, d = 3 is a trisection, and in general this is a decimation of order d.

Remark 9. The case of decimations of linear recurrences defined over finite fields is considered in [7].

Since, at least in the case that all the roots λ_{1}, λ_{2}, …, λ_{N} of F are distinct, the general solution of (38) can be written as a linear combination of kth powers of the λ_{j}, it is apparent that the terms of a decimation of order d are given by x_{i+dk} = ∑_{j=1}^{N} A_{j} λ_{j}^{dk}, for some coefficients A_{j}. Hence the decimation satisfies the linear recurrence

∏_{j=1}^{N}(S − λ_{j}^{d}) x_{i+dk} = 0.  (39)

(The recurrence for the decimation has the same form in the case of repeated roots.) Decimations of the sequence ( s_{k}(n) ) will be considered in Proposition 23 in the next section.

Given two sequences (x_{k}), (y_{k}) that satisfy linear recurrences of order N, M respectively, the product sequence

(z_{k}) = (x_{k}y_{k})

also satisfies a linear recurrence. The following result is well known.

Theorem 10. The product (z_{k}) = (x_{k}y_{k}) of two sequences that satisfy linear recurrences of order N, M satisfies a linear recurrence of order at most NM.

To prove the theorem in the generic situation where the recurrences for (x_{k}), (y_{k}) both have distinct characteristic roots, given by λ_{i}, 1 ≤ i ≤ N and μ_{j}, 1 ≤ j ≤ M respectively, observe that each product ν_{i,j} = λ_{i}μ_{j} is a characteristic root for the linear recurrence satisfied by (z_{k}), that is

∏_{i,j}(S − ν_{i,j}) z_{k} = 0,  (40)

where the sum is over a maximum set of i, j that give distinct ν_{i,j}; so if the ν_{i,j} are all different from each other then the order of the recurrence is exactly MN, but the order could be smaller if some of the ν_{i,j} coincide. For the general situation with repeated roots, see [33].

We now consider an observation concerning the sequences ( s_{k}(n) ) for the special values n = j^{2} − 2 where j ∈ ℤ, which includes the cases n = 7, 14, 23, 34 that have a_{n} = −1 in (12). The fact is that for all these values, there is a factorization of the form

s_{k}(j^{2} − 2) = r_{k}(j)s_{k}(j),  (41)

where both factors on the right-hand side above satisfy a linear recurrence of second order. This is surprising, because in the light of Theorem 10 one would naively expect such a product to satisfy a recurrence of order 4.

Theorem 11. For the values n = j^{2} − 2, the terms of the sequence ( s_{k}(n) ) admit the factorization (41), where r_{k}(j) satisfies the same recurrence as s_{k}(j), that is

r_{k+2}(j) − j r_{k+1}(j) + r_{k}(j) = 0,  (42)

with the initial values

r_{0}(j) = 1,  r_{1}(j) = j − 1.  (43)

Thus for all j ∈ ℤ the formula (41) expresses s_{k}(j^{2} − 2) as a product of two integers.

Proof. In the case n = j^{2} −2, the formula (35) fixes the characteristic roots of the recurrence (1) as λ = α^{2}, λ^{−1} = α^{−2}, where α = (j + \sqrt{j^{2} − 4})/2; so α + α^{−1} = j, and the square root of α can be fixed so that α^{1/2} + α^{−1/2} = \sqrt{j + 2}. Then, by applying the difference of two squares to the numerator and denominator of (36), it follows that

s_{k}(j^{2} − 2) = (\frac{α^{(2k+1)/2} + α^{−(2k+1)/2}}{α^{1/2} + α^{−1/2}} ) (\frac{α^{(2k+1)/2} − α^{−(2k+1)/2}}{α^{1/2} − α^{−1/2}} )  (44)

which is the factorization (41) with r_{k}(j) and s_{k}(j) given by making the replacement n → j in (34). (For an alternative expression for these factors, see (55) in Remark 16 below.) Each of the factors above is a linear combination of kth powers of the characteristic roots α, α^{−1}, and r_{k}(j) = (−1)^{k}s_{k}(−j) as in (14), so they each satisfy the same recurrence (42) with an appropriate set of initial values.

Remark 12. Generically, the product of any two solutions of the recurrence (42) would have three characteristic roots, namely α^{2}, α^{−2}, 1, giving a recurrence of order 3 in (40), but the potential root 1 cancels from the product (44), giving the second-order recurrence (1) with n = j^{2} − 2. An inductive proof of the preceding result was given by Klee in a post to the Seqfan mailing list: see [16] for details. However, the factorization (44) in the form L_{2k+1}^{−}(j, 1) = L_{2k+1}^{+}(\sqrt{j + 2}, 1) L_{2k+1}^{−}(\sqrt{j + 2}, 1) appears to be well known in the literature on Lehmer numbers; see e.g., [4] and references.^{2}

Example 13. In the case n = 7, there is the factorization

s_{k}(7) = r_{k}(3) s_{k}(3),

where the first terms of the factor sequences are

\begin{matrix}( r_{k}(3) ) : 1, 2, 5, 13, 34, 89, 233, 610, 1597, …, \\ ( s_{k}(3) ) : 1, 4, 11, 29, 76, 199, 521, 1364, 3571, …, \end{matrix}

which multiply together to give the terms in (13). Since both ( r_{k}(3) ) and ( s_{k}(3) ) are strictly increasing sequences, it follows that s_{k}(7) is composite for all k ≥ 1, and hence a_{7} = −1, as asserted previously.

As a consequence of the factorization (41), one can show similarly that for all integers j ≥ 3, the terms s_{k}(j^{2} − 2) are composite for k ≥ 1, and thus a_{j^{2}−2} = −1 for all j ≥ 3 (for full details, see the proof of Theorem 38 below). In particular, Theorem 11 accounts for all the values n = 7, 14, 23, 34 with a_{n} = −1 that are shown in the list (12).

The question is now whether there are other cases with a_{n} = −1, for which n ≠ j^{2} − 2 for some j. It turns out that the answer to this question is affirmative, and the first case with a_{n} = −1 that does not fit into the above pattern is n = 110 [15].

Example 14. The sequence ( s_{k}(110) )_{k≥0}, beginning with

\begin{matrix}1, 111, 12209, 1342879, 147704481, 16246150031, 1786928798929, \\ 196545921732159, …, \end{matrix}  (45)

appears as number \underline{A298677} in the OEIS. To see that none of the terms are prime, first of all note that the sequence ( s_{k}(110) mod 111 ) is periodic with period 3: it is equivalent to the sequence (8); this observation is a special case of Lemma 27 below. Thus it is helpful to consider the three trisections ( s_{3k+i}(110) ) for i = 0, 1, 2, each of which satisfy the secondorder recurrence

s_{3(k+2)+i}(110) − 1330670 s_{3(k+1)+i}(110) + s_{3k+i}(110) = 0,  (46)

2In particular, see http://primes.utm.edu/top20/page.php?id=47 for a sketch of a proof of Theorem 11.

as follows by applying the formula (39). The easiest case is i = 1, since s_{3k+1} ≡ 0 (mod 111) for all k; so in this subsequence, the first term 111 = 3 × 37 is composite, and subsequent terms 147704481 = 111 × 1330671, 196545921732159 = 111 × 1770683979569, etc. are all multiples of 111. The trisection ( s_{3k}(110) ) is the subsequence beginning with s_{0}(110) = 1, and then s_{3}(110) = 1342879 = 9661 × 139, s_{6}(110) = 1786928798929 = 116876761 × 15289, and by induction it can be shown that each of these terms is divisible by the corresponding one for the sequence ( s_{3k}(5) ) = 1, 139, 15289, …, so that

s_{3k}(110) = R_{3k}(5) s_{3k}(5),  (47)

where the integer sequence of prefactors satisfies the third order recurrence

R_{3(k+3)}(5) − 12099 (R_{3(k+2)}(5) − R_{3(k+1)}(5)) − R_{3k}(5) = 0.  (48)

Similarly, for the remaining trisection, namely ( s_{3k+2}(110) ), one has

s_{3k+2}(110) = R_{3k+2}(5) s_{3k+2}(5),  (49)

where the prefactor sequence ( R_{3k+2}(5) ) consists of integers and satisfies the same recurrence (48). In fact, it is not necessary to consider this trisection separately, since its properties follow immediately from extending ( s_{3k}(110) ) to k < 0 and using the symmetry (4). These observations show that all the terms in (45) are composite for k > 0, confirming that a_{110} = −1 as claimed. Moreover, for all k there is a factorization

s_{k}(110) = R_{k}(5) s_{k}(5),  (50)

where

R_{k+3}(5) − 24 (R_{k+2}(5) − R_{k+1}(5)) − R_{k}(5) = 0,  (51)

but the prefactors making up the full sequence ( R_{k}(5) )_{k≥0}, that is

1, \frac{37}{2}, 421, 9661, \frac{443557}{2}, 5091241, 116876761, \frac{5366148517}{2}, …,

are only integers in the cases (47) and (49), and not when k ≡ 1 (mod 3).

The values of n with a_{n} = −1 mentioned so far all have one thing in common: they correspond to values of dilated Chebyshev polynomials of the first kind. Indeed, the four -1 terms displayed in (12) appear at the index values

7 = T_{2}(3), 14 = T_{2}(4), 23 = T_{2}(5), 34 = T_{2}(6),

and Theorem (11) implies that s_{k}(n) is composite for all k ≥ 1 when n = T_{2}(j), j ≥ 3, while

110 = T_{3}(5).

It turns out that for any Chebyshev value n = T_{p}(j) with p > 1, there is a factorization analogous to (41) or (50): see Theorem 37 below. Due to the identity (26), it is sufficient to consider the case of prime p only.

The curious reader might wonder why the values n = 18 = T_{3}(3) and n = 52 = T_{3}(4) are missing from the discussion. The reason is that, although there is a factorization analogous to (50) for these values of n, there are the prime terms s_{1}(18) = 19 and s_{1}(52) = 53, which imply that a_{18} = 1 = a_{52}; but it turns out that there are no other primes in the sequences ( s_{k}(n) )_{k≥0} for n = 18 or 52. See Theorem 38 for a more general statement which includes all these Chebyshev values.

4 General properties of the defining sequences

By writing the general solution of (1) in terms of the roots of its characteristic quadratic, and using various expressions for the dilated Chebyshev polynomials, as in section 2, we immediately obtain a number of equivalent explicit formulae for the sequence ( s_{k}(n) ).

Proposition 15. The terms of the sequence generated by (1) with the initial values (2) are given explicitly by

s_{k}(n) = \frac{λ^{k+1} − λ^{−k}}{λ − 1} = U_{k−1}(n) + U_{k}(n),  (52)

where λ is given in terms of n according to (20), and by

s_{k}(n) = U_{2k}(\sqrt{n + 2}) = \frac{sin ((2k + 1)θ/2)}{sin(θ/2)},  (53)

and they have the generating function

G(X, n) := ∑_{j=0}^{∞} s_{j}(n) X^{j} = \frac{1 + X}{1 − nX + X^{2}} .  (54)

Proof. The first formula in (52) is equivalent to (36), with λ = α^{2}, and the other one follows by rewriting the Chebyshev polynomials as linear combinations of λ^{k} and λ^{−k}, which generically provide two independent solutions of (1).^{3} For the latter set of identities, let m = \sqrt{n + 2}, and note that T_{2}(m) = n, so θ can always be chosen such that m = 2 cos(θ/2). The expression on the far right-hand side of (53) is obtained by by applying (23) to the last equality in (52), or by setting α = e^{iθ/2} in (36), and this expression equals U_{2k}(2 cos(θ/2)) = U_{2k}(m). The generating function (54) follows from using the first formula in (52) and summing a pair of geometric series.

3The first equality is invalid when n = ±2, due to repeated roots λ = λ^{−1} = ±1, cf. (10) and (11).

Remark 16. The last formula in (52) together with (14) shows that the terms on the righthand side of the factorization (41) in the case n = T_{2}(j) = j^{2} − 2 can also be written as

r_{k}(j) = U_{k}(j) − U_{k−1}(j),  s_{k}(j) = U_{k}(j) + U_{k−1}(j).  (55)

If 5/2 < n ∈ ℝ then λ > 2, so λ^{−k}/(λ − 1) < 1 for all k ≥ 0, and so we have

Corollary 17. For all real n > 5/2, the terms s_{k}(n) for k ≥ 0 are given by

s_{k}(n) = ⌊\frac{λ^{k+1}}{λ − 1}⌋ .

The recurrence (1) can also be rewritten in matrix form, as

v_{j} = A v_{j−1},  (56)

where

A = ( \begin{matrix}0 & 1 \\ −1 & n \end{matrix} ) , v_{j} = ( \begin{matrix}s_{j}(n) \\ s_{j+1}(n) \end{matrix} ) ,

hence for all j the terms of the sequence are given in terms of the powers of A by

v_{j} = A^{j} v_{0}.

By a standard method of repeated squaring, this allows rapid calculation of the terms of the sequence.

Proposition 18. The jth power of the matrix A is given explicitly by

A^{j} = ( \begin{matrix}−U_{j−2}(n) & U_{j−1}(n) \\ −U_{j−1}(n) & U_{j}(n) \end{matrix} ) ,  (57)

and this can be calculated in O(log j) steps.

Proof. The formula (57) follows by induction, noting that the columns of the matrix on the right-hand side satisfy the same recurrence (56) as the vector v_{j}, and it is trivially true for j = 0. To calculate the powers of A quickly, compute the binary expansion j = ∑_{i=0}^{d−1} b_{i} 2^{i}, where b_{d−1} = 1 and d = log_{2} j +1 is the number of bits, then use repeated squaring to obtain the sequence Ã_{i} = A^{2^{i}} for i = 0, 1, …, d − 1, and finally evaluate A^{j} = ∏_{i=0}^{d−1} Ã_{i}^{b_{i}}.

There are other useful representations for the terms s_{k}(n), two of which we record in the following

Proposition 19. For k ≥ 0, the terms of the sequence ( s_{k}(n) ) admit the expansion

s_{k}(n) = \begin{matrix}⌊ & \frac{k}{2} & ⌋ \\ ∑ \\ i=0 \end{matrix}(−1)^{i}\binom{k − i}{i}n^{k−2i} + \begin{matrix}⌊ & \frac{k−1}{2} & ⌋ \\ ∑ \\ i=0 \end{matrix}(−1)^{i}\binom{k − i − 1}{i}n^{k−2i−1}  (58)

in powers of n, and the expansion

s_{k}(n) = \frac{1}{2}T_{0}(n) + ∑_{i=1}^{k} T_{i}(n)  (59)

in terms of dilated Chebyshev polynomials of the first kind.

Proof. The first expansion (58) follows from the expression on the far right-hand side of (52), together with equation (28). The second expansion (59) corresponds to a standard identity for the Dirichlet kernel; it can be proved by noting that dilated first/second kind Chebyshev polynomials are related via the identity T_{k}(n) = 2U_{k}(n) − nU_{k−1}(n), which is easily verified. Taken together with the recurrence (22), as well as the last expression in (52), this gives

s_{k}(n) − s_{k−1}(n) = T_{k}(n).  (60)

Thus the expansion (59) is obtained by starting from s_{0} = 1 = \frac{1}{2}T_{0} and then taking the telescopic sum of the first difference formula (60).

Remark 20. A different form of series expansion for the airfoil polynomials of the second kind is given in [5].

Proposition 21. For any odd integer p,

s_{k+p}(n) − s_{k}(n) = T_{k+ \frac{p+1}{2}} (n) s_{(p−1)/2}(n).  (61)

Proof. This follows from the trigonometric expression on the far right-hand side of (53), by applying the addition formula (23).

Remark 22. The formula (60) is the particular case p = 1 of the above identity.

Proposition 23. Any decimation ( s_{i+dk}(n) ) of the sequence of order d, satisfies the linear recurrence

s_{i+d(k+1)}(n) − T_{d}(n) s_{i+dk}(n) + s_{i+d(k−1)}(n) = 0.  (62)

Proof. By the first formula for s_{k}(n) in (52), the terms of the decimated sequence can be written as linear combinations of kth powers of λ^{d} and λ^{−d}, so from the formula (39) we find

(S^{2} − (λ^{d} + λ^{−d}) S + 1) s_{i+dk}(n) = 0,

and by using (20) we see that λ^{d} + λ^{−d} = 2 cos(dθ) = T_{d}(n), which verifies (62).

It is worth highlighting some particular cases of the preceding two results, namely the formulae

s_{2j}(n) + 1 = s_{j}(n) T_{j}(n), s_{2j+1}(n) − 1 = s_{j}(n) T_{j+1}(n), (63)

of which the first arises by setting i = 0, k = 1, d = j in (62), while the second comes from taking k = 0, p = 2j + 1 in (61). For primality testing of a number q, it is often useful to have a factorization, or a partial factorization, of either q − 1 or q + 1 [2, 22], and each of the identities in (63) also has an analogue where the sign of the ±1 term on the left-hand side is reversed.

Proposition 24. For any integer j,

s_{2j}(n) − 1 = (n + 2) r_{j}(n) U_{j−1}(n),  s_{2j+1}(n) + 1 = (n + 2) r_{j}(n) U_{j}(n).  (64)

Proof. For the first identity in (64), using λ = α^{2} with α = e^{iθ/2} and n = λ+λ^{−1} yields n+2 = (α + α^{−1})^{2}, and then from (37) and the definition of the dilated Chebyshev polynomials of the second kind it follows that (n + 2)r_{j}(n) U_{j−1}(n) is equal to

(α + α^{−1})^{2} (\frac{α^{2j+1} + α^{−(2j+1)}}{α + α^{−1}} ) (\frac{α^{2j} − α^{−2j}}{α^{2} − α^{−2}} ) = (\frac{α^{4j+1} − α^{−(4j+1)}}{α − α^{−1}} ) − 1

which is precisely s_{2j}(n) − 1, by (36). The proof of the second identity is similar.

Another basic fact we shall use is that, with a suitable restriction on n, s_{k}(n) is monotone increasing with k.

Proposition 25. For each real n ≥ 2, the sequence ( s_{k}(n) ) is strictly increasing, and grows exponentially with leading order asymptotics

s_{k}(n) ∼ \frac{1}{2} (1 + \sqrt{\frac{n + 2}{n − 2}}) (\frac{n + \sqrt{n^{2} − 4}}{2})^{k} as k → ∞,

for all n > 2.

Proof. For real n ≥ 2, from (20) we can set

τ = iθ = log (\frac{n + \sqrt{n^{2} − 4}}{2}) ,

which defines a bijection from the interval n ∈ [2, ∞) to τ ∈ [0, ∞). The inverse is

n = 2 coshτ ⟹ \frac{dn}{dτ} = 2 sinhτ > 0,

and we have

T_{k}(n) = 2 cosh(kτ) ⟹ \frac{d}{dτ} T_{k}(n) = 2k sinh(kτ) > 0

for τ > 0; hence, for all fixed k, T_{k}(n) is a strictly increasing function of n for n ≥ 2. Similarly, \frac{d}{dk} T_{k}(n) = 2τ sinh(kτ) so for all fixed n > 2, the sequence ( T_{k}(n) )_{k≥0} is also strictly increasing with k. Then since T_{k}(2) = 2 for all k, it follows that, for all k,

T_{k}(n) ≥ 2 ∀n ≥ 2,  (65)

so from (60) we have

s_{k}(n) − s_{k−1}(n) ≥ 2.

Upon taking the leading term of the explicit expression in terms of λ in (52) and rewriting it as a function of n, the asymptotic formula results.

We can now use the explicit formulae above to derive various arithmetical properties of the integer sequences defined by s_{k}(n) for positive integers n. This will culminate in Lemma 29 below, which describes coprimality conditions on the terms, as well as Lemma 32 and its corollaries, which constrain where particular prime factors can appear. To begin with we describe where primes can appear in the sequence.

Lemma 26. For all integers n ≥ 2, if s_{k}(n) is prime then k = (p − 1)/2 for p an odd prime.

Proof. If 2k + 1 = ab is composite, for some odd integers a, b ≥ 3, then the identity (27) can be applied to the middle expression in (53), to write s_{k}(n) as the product

\begin{aligned}s_{k}(n) & = & U_{a−1} (T_{b}(\sqrt{n + 2})) U_{b−1}(\sqrt{n + 2}) \\ & = & s_{(a−1)/2} (T_{b}(\sqrt{n + 2})^{2} − 2) s_{(b−1)/2}(n). \end{aligned}

Then, since T_{2}(j) = j^{2} − 2, by using (26) we have

\begin{aligned}s_{k}(n) & = & s_{(a−1)/2} (T_{2b}(\sqrt{n + 2})) s_{(b−1)/2}(n) \\ & = & s_{(a−1)/2} (T_{b}(n)) s_{(b−1)/2}(n), \end{aligned}  (66)

and each factor above is an integer greater than 1.

Henceforth we will consider only integer values of n. It is well known that all linear recurrence sequences defined over ℤ are eventually periodic mod m for any modulus m [32]; and for the recurrence (1) we can say further that it is strictly periodic mod m, because the linear map (s_{k}, s_{k+1}) ↦ (s_{k+1}, s_{k+2}) defined by the matrix A in (56) is always invertible mod m (since det A = 1). However, in order to obtain coprimality conditions, we need a lemma that explicitly describes the periodicity of the terms s_{k}(n) mod s_{j}(n) for fixed j.

Lemma 27. For all integers n ≥ 2 and any odd number p ≥ 3, the sequence of residues s_{k}(n) mod s_{(p−1)/2}(n) is periodic with period p, and s_{k}(n) ≡ 0 (mod s_{(p−1)/2}(n)) if and only if k ≡ (p − 1)/2 (mod p).

Proof. The identity (61) implies that, for all k,

s_{k+p}(n) ≡ s_{k}(n) (mod s_{(p−1)/2}(n)),

so the residues repeat with period p. By the monotonicity result in Proposition 25,

1 = s_{0}(n) < s_{1}(n) < ⋯ < s_{(p−3)/2}(n) < s_{(p−1)/2}(n).

Then the symmetry (4) implies that the residues mod s_{(p−1)/2}(n) are non-zero in the range −(p − 1)/2 ≤ k ≤ (p − 3)/2, so the rest of the statement follows from the periodicity.

Lemma 28. For each integer n ≥ 2 and any odd integer p ≥ 3, s_{k}(n) is coprime to s_{(p−1)/2}(n) if and only if (p − 1)/2 − k is coprime to p.

Proof. Once again, we drop the argument n for the purposes of the proof, and perform induction on the odd integers p ≥ 3. With p fixed, for each k it will be convenient to consider

m = (p − 1)/2 − k.  (67)

For the base case p = 3, note that the sequence of s_{k} mod s_{1} repeats with period 3, by Lemma 27, and clearly gcd(s_{0}, s_{1}) = 1 = gcd(s_{−1}, s_{1}) so the pattern is s_{k} ≡ −1, 1, 0 (mod s_{1}) for k ≡ −1, 0, 1 (mod 3); hence gcd(s_{k}, s_{1}) = 1 if and only if the quantity m = 1 − k ≢ 0 (mod 3), which is the required result in this case. Now we will assume that the result is true for all odd q with 3 ≤ q < p, and proceed to show that it is true for p.

Firstly, if for some k the corresponding value of m, given by (67), is not coprime to p, then there is some odd q with 3 ≤ q ≤ p, q|m and q|p. Therefore we have

(q − 1)/2 − k = (q − p)/2 + m ≡ (q − p)/2 ≡ 0 (mod q).

So by Lemma 27, both s_{k} ≡ 0 (mod s_{(q−1)/2}) and s_{(p−1)/2} ≡ 0 (mod s_{(q−1)/2}), hence s_{k} and s_{(p−1)/2} are not coprime.

Thus it remains to show that

gcd(m, p) = 1 ⟹ gcd(s_{(p−1)/2−m}, s_{(p−1)/2}) = 1.

Observe that, by Lemma 27, it is sufficient to verify this for values of m between 1 and p − 1 (i.e., the non-zero residue classes mod p). First consider k = (p−1)/2−m lying in the range 0 ≤ k ≤ (p − 3)/2: this can be written as k = (q − 1)/2 for some odd positive integer q, and gcd(m, p) = 1 is equivalent to the requirement that gcd(q, p) = 1; so either q = 1 and gcd(s_{0}, s_{(p−1)/2}) = 1 is trivially true, or 3 ≤ q < p − 2 and gcd(s_{(q−1)/2}, s_{(p−1)/2}) = 1 holds by the inductive hypothesis. Now for the range −(p − 1)/2 ≤ k ≤ −1, the result follows by the symmetry k → −1 − k, using (4). Hence, by applying the shift k → k + p and using Lemma 27, the result is true for all integers k such that gcd((p − 1)/2 − k, p) = 1.

In fact, it is possible to make a stronger statement about the common factors of the terms of the sequence.

Lemma 29. For all integers n ≥ 2 and j, k ≥ 0,

gcd (s_{j}(n), s_{k}(n)) = s_{m}(n), where 2m + 1 = gcd(2j + 1, 2k + 1).

Proof. Given any j, k, suppose that 2m + 1 = gcd(2j + 1, 2k + 1). The case m = 0 follows from Lemma 28, taking p = 2j + 1. If m > 0, then by writing 2j + 1 = (2m + 1)(2j′ + 1), 2k + 1 = (2m + 1)(2k′ + 1) with gcd(2j′ + 1, 2k′ + 1) = 1, and applying (66), we have

gcd (s_{j}(n), s_{k}(n)) = s_{m}(n) gcd (s_{j′}(T_{2m+1}(n)), s_{k′}(T_{2m+1}(n))) = s_{m}(n),

by applying Lemma 28 once again.

Remark 30. The preceding result is a special case of a result on the greatest common divisor of a pair of Lehmer numbers: see Lemma 3 in [29].

Remark 31. Since the argument n plays a passive role in most of the above, it is clear that, mutatis mutandis, Lemmas 27, 28 and 29 also apply to the sequence of polynomials ( s_{k}(n) ) in ℤ[n]. Analogous divisibility properties for the Chebyshev polynomials of the first kind are described in [23].

The preceding results allow the periodicity of the sequence modulo any prime to be described quite precisely. The notation (\frac{·}{·}) is used below to denote the Legendre symbol.

Lemma 32. Let n ≥ 2 be fixed, and for any prime q let π(q) denote the period of the sequence (s_{k}(n) mod q). Then π(2) = 3 if and only if n is odd, in which case s_{k}(n) is even ⟺ k ≡ 1 (mod 3), while π(2) = 1 and all s_{k}(n) are odd when n is even. Moreover, for q an odd prime, one of three possibilities can occur: (i) (\frac{n^{2}−4}{q}) = ±1 and π(q)|q ∓ 1; (ii) n ≡ 2 (mod q) and π(q) = q with s_{k}(n) ≡ 0 (mod q) ⟺ q|2k + 1; (iii) n ≡ −2 (mod q) and π(q) = 2 with s_{k}(n) ≡ (−1)^{k} (mod q).

Proof. When n is even, then since s_{0}(n) = 1 and s_{1}(n) = n + 1 are both odd, it follows from (1) that s_{k}(n) is odd for all k, so π(2) = 1. For n odd, s_{1}(n) is even, so by Lemma 28, s_{k}(n) is even if and only if k ≡ 1 (mod 3), and π(2) = 3.

Now let q be an odd prime. For case (i) it is most convenient to consider the behaviour of (s_{k} mod q) in terms of the equivalent sequence defined by the recurrence (1) in the finite field 𝔽_{q}. In that case we have n > 2, and when (\frac{n^{2}−4}{q}) = 1 it follows that n^{2} −4 is a quadratic residue mod q, so the first formula in (52), which can be rewritten as

s_{k}(n) = \frac{λ^{−k}(λ^{2k+1} − 1)}{λ − 1},  (68)

remains valid in terms of λ ∈ 𝔽_{q}, with λ ≠ ±1, and λ^{q−1} = 1 in 𝔽_{q} by Fermat’s little theorem. The terms of the sequence repeat with period π(q) = ord(λ) > 2, the multiplicative order of λ in the group 𝔽_{q}^{∗}, and this divides q − 1 by Lagrange’s theorem. The case (\frac{n^{2}−4}{q}) = −1 is similar, but now n^{2} − 4 is a quadratic nonresidue mod q, so λ is not defined in 𝔽_{q} and the formula (68) should be interpreted in the field extension 𝔽_{q}[\sqrt{n^{2} − 4}] ≃ 𝔽_{q^{2}}. The Frobenius automorphism λ → λ^{q} exchanges the roots of the quadratic X^{2}−n X +1 = (X −λ)(X −λ^{−1}), hence λ^{q} = λ^{−1}. Thus λ^{q+1} = 1, and now the sequence given by (68) repeats with period π(q) = ord(λ), the order of λ in 𝔽_{q^{2}}^{∗}, which divides q+1. In case (ii), the sequence s_{k}(n) mod q is the same as the sequence (10) mod q, which first vanishes when k = (q − 1)/2 and repeats with period q, and in case (iii) the sequence is equivalent to (11), which is never zero mod q.

At this stage it is convenient to introduce the notion of a primitive prime divisor (sometimes just referred to as a primitive divisor), which is a prime factor q that divides s_{k}(n) but does not divide any of the previous terms in the sequence [10], and by convention does not divide the discriminant n^{2} − 4 either [1, 26].

Definition 33. Let the product of the discriminant and the first k terms be denoted by

Π_{k}(n) = (n^{2} − 4) s_{1}(n)s_{2}(n) ⋯ s_{k}(n).  (69)

A primitive prime divisor of s_{k}(n) is a prime q|s_{k}(n) such that q |̸ Π_{k−1}(n).

Case (i) of Lemma 32 is the most interesting one. In that case it is clear from (68) that a prime q|s_{k}(n) for some k whenever λ^{2k+1} = 1 in 𝔽_{q^{2}} ⊃ 𝔽_{q}, and then π(q) = ord(λ) = 2k^{∗} + 1 must be odd, where k^{∗} = (π(q) − 1)/2 > 0 is the smallest k for which this happens; and if π(q) is even then this cannot happen. If we include q = 2, then we can rephrase the latter by saying that the prime factors q appearing in the sequence ( s_{k}(n) ) are precisely those q which have an odd period π(q) > 1, and this consequence of Lemma 32 can be restated in terms of primitive prime divisors.

Corollary 34. A prime q is a primitive divisor of s_{k}(n) if and only if k = (π(q) − 1)/2 where π(q) is odd. Moreover, if q is odd and (\frac{n^{2}−4}{q}) = ±1 then q = 2aπ(q) ± 1 for some positive integer a.

The latter statement just says that an odd primitive divisor of s_{k}(n) has the form q = 2a(2k +1)±1 for some a ≥ 1, so the minus sign with a = 1 gives the lower bound q ≥ 4k +1. Hence the primes that do not appear as factors in the sequence can also be characterized.

Corollary 35. If a prime q < 4k + 1 is not a factor of Π_{k−1}(n), then it never appears as a factor of s_{j}(n) for j ≥ k, and π(q) is even.

So far we have concentrated on properties of s_{k}(n) for fixed n and allowed k to vary. However, if one is interested in finding factors of s_{k}(n) for large n, then it may also be worthwhile to consider other values of n, as the following result shows.

Proposition 36. Suppose that an integer f|s_{k}(n) for some k, n. Then f|s_{k}(m) whenever m ≡ n (mod f).

Proof. If m ≡ n (mod f) then m^{j} ≡ n^{j} (mod f) for any exponent j ≥ 0, and since s_{k}(m) is a polynomial in m with integer coefficients, it follows that s_{k}(m) ≡ s_{k}(n) ≡ 0 (mod f), as required.

5 Generic factorization for Chebyshev values

The sequence ( s_{k}(n) ) has special properties when n is given by a dilated Chebyshev polynomial of the first kind evaluated at an integer value of the argument.

Theorem 37. For all integers p ≥ 2, when n = T_{p}(j) for some integer j the terms of the sequence ( s_{k}(n) ) can be factorized as a product of rational numbers, that is

s_{k}(T_{p}(j)) = R_{k}(j) s_{k}(j),  (70)

where the prefactors R_{k}(j) ∈ ℚ are given by

R_{k}(j) = \frac{U_{p−1}(T_{2k+1}(\sqrt{j + 2}))}{U_{p−1}(\sqrt{j + 2})}  (71)

and satisfy a linear recurrence of order p. In particular, for p = 2 the prefactor is R_{k}(j) = r_{k}(j) ∈ ℤ, as given in Theorem 11, while for all odd p the prefactor can be written as

R_{k}(j) = \frac{s_{(p−1)/2}(T_{2k+1}(j))}{s_{(p−1)/2}(j)} ∈ ℚ,  (72)

and satisfies the recurrence

(S − 1) ∏_{i=1}^{(p−1)/2}(S^{2} − T_{2i}(j) S + 1) R_{k}(j) = 0.  (73)

Proof. Upon introducing ϕ such that ℓ = \sqrt{j + 2} = 2 cos(ϕ/2), the formula (53) gives

R_{k}(j) = \frac{s_{k}(T_{p}(j))}{s_{k}(j)} = \frac{sin ((2k + 1)pϕ/2) sin(ϕ/2)}{sin(pϕ/2) sin ((2k + 1)ϕ/2)},

and the definition of the dilated Chebyshev polynomials of the second kind in (21) produces (71). For integer j, R_{k}(j) is a ratio of integers, so it is a rational number (positive for j ≥ 2). In the case p = 2, R_{k}(j) = r_{k}(j), which can be written in the form

r_{k}(j) = \frac{T_{2k+1}(\sqrt{j + 2})}{\sqrt{j + 2}},  (74)

which is an integer, as follows from the fact that U_{1}(ℓ) = ℓ, and this ratio is an even polynomial of degree 2k in ℓ with integer coefficients, hence it is a polynomial of degree k in j; and by (65) it is positive for real j ≥ 2, and takes positive integer values for integers j in this range. In the case that p is odd, the expression (72) is found by applying the formula (53) to the numerator and denominator of (71).

To see that R_{k}(j) satisfies a linear recurrence of order p, note that, upon setting μ = exp(iϕ) and applying the first formula in (52) with λ = μ^{p}, the factorization (70) can be seen as a consequence of the elementary algebraic identity

\frac{μ^{p(k+1)} − μ^{−pk}}{μ^{p} − 1} = (\frac{∑_{j=0}^{p−1} μ^{(k+1)(p−1)−(2k+1)j}}{μ^{p−1} + μ^{p−2} + ⋯ + 1} ) (\frac{μ^{k+1} − μ^{−k}}{μ − 1} ) ,  (75)

where the first factor on the right-hand side above is just R_{k}(j). Thus the denominator of the expression for R_{k}(j) in (75) is ∑_{j=0}^{p−1} μ^{j}, which is independent of k, while the numerator is a linear combination of kth powers of the characteristic roots μ^{(p−1)}, μ^{(p−3)}, …, μ^{−(p−3)}, μ^{−(p−1)}, giving a total of p distinct roots. When p is even, the roots come in p/2 pairs, namely μ^{±(2i−1)} for i = 1, …, p/2, which gives the characteristic polynomial

F (λ) = ∏_{i=1}^{p/2}(λ^{2} − T_{2i−1}(j)λ + 1),

so that, in particular, for p = 2 the recurrence satisfied by R_{k}(j) is (42), while for p odd there are the pairs μ^{±2i} for i = 1, …, (p − 1)/2 together with the root 1, which yields (73).

Theorem 38. Let (a_{n})_{n≥1} be the sequence specified by Definition 1. If n = T_{2}(j) for some j ≥ 3, then a_{n} = −1. Furthermore, if n = T_{p}(j) for some j ≥ 3 with p an odd prime, then either s_{(p−1)/2}(n) is not prime and a_{n} = −1, or s_{(p−1)/2}(n) is the only prime in the sequence ( s_{k}(n) )_{k≥0} and a_{n} = (p − 1)/2.

Proof. First of all, consider the factorization (70) when p = 2, with prefactor r_{k}(j) as in Theorem 11, given by (74). When j = 2 this is not interesting, because it gives r_{k}(j) = 1 for all j. However, note the property (mentioned in passing in the proof of Proposition 25), that for real n > 2, the sequence ( T_{k}(n) )_{k≥0} is strictly increasing with the index. Hence, for all k > 0, T_{2k+1}(\sqrt{j + 2}) > \sqrt{j + 2} = T_{1}(\sqrt{j + 2}). Thus for all j ≥ 3 and k ≥ 1, both factors r_{k}(j), s_{k}(j) are greater than 1, so s_{k}(T_{2}(j)) can never be prime, and a_{n} = −1.

Now for any odd prime p, note that, a priori, the prefactor R_{k}(j) in (70) is a positive rational number, and the formula (72) gives

s_{k}(T_{p}(j)) = \frac{s_{k}(j) s_{(p−1)/2}(T_{2k+1}(j))}{s_{(p−1)/2}(j)}.  (76)

However, according to Lemma 27, s_{(p−1)/2}(j)|s_{k}(j) whenever k ≡ (p − 1)/2 (mod p). On the other hand, for all values of k ≢ (p − 1)/2 (mod p), Lemma 28 gives gcd(s_{k}(j), s_{(p−1)/2}(j)) = 1. Therefore s_{(p−1)/2}(j) divides s_{(p−1)/2}(T_{2k+1}(j)) and R_{k}(j) ∈ ℤ. Thus, for all k, the terms s_{k}(T_{p}(j)) can be written as a product of two integers, that is

s_{k}(T_{p}(j)) = \begin{cases}R̂_{k}(j) s_{(p−1)/2}(T_{2k+1}(j)), & if k ≡ (p − 1)/2 (mod p); \\ R_{k}(j) s_{k}(j), & otherwise, \end{cases}  (77)

where R_{k}(j) is given by (72) as above, and

R̂_{k}(j) = \frac{s_{k}(j)}{s_{(p−1)/2}(j)} = s_{i}(T_{p}(j)) for k = (p − 1)/2 + ip,  (78)

with the latter formula being obtained from (66). In the first case of (77) above, for k = (p − 1)/2 the prefactor is R̂_{(p−1)/2}(j) = 1, while R̂_{k}(j) > 1 for all k = (p − 1)/2 + ip, i ≥ 1, by Lemma 25, and the other factor is s_{(p−1)/2}(T_{2k+1}(j)) > 1 for all these values of k. In the second case, for k > 0, we can use (59) together with (26) to write

s_{(p−1)/2}(T_{2k+1}(j)) = \frac{1}{2}T_{0} + ∑_{i=1}^{(p−1)/2} T_{i}(T_{2k+1}(j))
= \frac{1}{2}T_{0} + ∑_{i=1}^{(p−1)/2} T_{(2k+1)i}(j)
> \frac{1}{2}T_{0} + ∑_{i=1}^{(p−1)/2} T_{i}(j) = s_{(p−1)/2}(j),

so s_{(p−1)/2}(T_{2k+1}(j))/s_{(p−1)/2}(j) > 1. Hence both factors R_{k}(j), s_{k}(j) are greater than 1 in the second case of (77). Thus the only term that can be prime is s_{(p−1)/2}(T_{p}(j)), and the result is proved.

Remark 39. For any odd p = 2i + 1, the identity (76) can be rewritten in the symmetric form

s_{i}(j) s_{k}(T_{2i+1}(j)) = s_{k}(j) s_{i}(T_{2k+1}(j)).  (79)

Remark 40. Similarly to the remark after Lemma 29, the formula (77) also corresponds to factorizations of the corresponding polynomials in ℤ[j], according to whether k ≡ (p − 1)/2 (mod p) or not.

It is clear from the factorizations (77) that in the second case, s_{k}(T_{p}(j)) ≡ 0 (mod s_{k}(j)) whenever k is not congruent to (p − 1)/2 mod p. It turns out that an explicit expression for s_{k}(T_{p}(j)) mod s_{k}(j) can be given in the first case as well. Before doing so, it is convenient to define some more polynomials, which are shifted versions of the airfoil polynomials.

Definition 41. Polynomials P_{k}(z) are defined as elements of ℤ[z] by

P_{k}(z) = s_{k}(2 − z),

or equivalently by

P_{k}(4 sin^{2} θ) = \frac{sin ((2k + 1)θ)}{sin θ}.  (80)

They satisfy the linear recurrence

P_{k+1}(z) + (z − 2)P_{k}(z) + P_{k−1}(z) = 0,  (81)

and for k ≥ 0 their expansion in powers of z takes the form

P_{k}(z) = 2k + 1 − c_{k}^{(1)} z + c_{k}^{(2)} z^{2} + ⋯ + (2k + 1)(−z)^{k−1} + (−z)^{k}.  (82)

with

c_{k}^{(1)} = \frac{k(k + 1)(2k + 1)}{3!}, c_{k}^{(2)} = \frac{k(k − 1)(k + 1)(2k^{2} + 5k + 2)}{5!}.

Theorem 42. For all odd integers p,

s_{k}(T_{p}(j)) = s_{i}(T_{p}(j)) P_{(p−1)/2}((2 − j) s_{k}(j)^{2}) for k = (p − 1)/2 + ip,  (83)

and in particular,

s_{k}(T_{p}(j)) ≡ p s_{i}(T_{p}(j)) (mod (j − 2) s_{k}(j)^{2})

holds in that case.

Proof. Upon setting p = 2q + 1, by using (78) together with the first formula in (77), we have

s_{k}(T_{p}(j))/s_{i}(T_{p}(j)) = sin ((2q + 1)(2k + 1)ϕ/2)/sin ((2k + 1)ϕ/2)
= P_{q}(z),  where z = 4 sin^{2} ((2k + 1)ϕ/2),

and (with the same notation as in the proof of Theorem 37) we also have j = 2 cos ϕ. Comparing the expressions for z and j gives z = 4 sin^{2}(ϕ/2) s_{k}(j)^{2} = (2 − j) s_{k}(j)^{2}, which yields the identity (83) in terms of the shifted airfoil polynomial P_{(p−1)/2}. The terms displayed in the expansion (82) are easily obtained from the recurrence (81), or by substituting n = 2−z in (58), and the leading term gives the reduction of (83) mod s_{k}(j)^{2}.

We now turn to the sequences ( r_{k}(n) ) for n > 0, which are associated with negative values of n via (14). It turns out that these sequences also admit factorizations for certain Chebyshev values of n. The case of n = T_{p}(j) for odd index p can be inferred immediately from Theorem 37 together with (14), since T_{p} is an odd function of its argument in that case. However, the even case n = T_{2}(j) does not translate directly to the sequences ( r_{k}(n) ), and requires a separate treatment. That there should be a significant difference for values of even Chebyshev polynomials is also apparent from comparison of the fact that a_{7} = a_{14} = a_{23} = a_{34} = −1 in (12), but ã_{1} = ã_{2} = ã_{34} = −1 in (18), while ã_{7}, ã_{14} and ã_{23} are all positive.

The following analogue of Theorem 11 for the sequences ( r_{k}(n) ) only provides a factorization of the terms for a particular subset of the values n = T_{2}(j) .

Theorem 43. When n = T_{2}(j) = j^{2} − 2 with j = 2(ℓ^{2} − 1) for integer ℓ ≥ 2, the terms of the sequence ( r_{k}(n) ) admit the factorization

r_{k}(j^{2} − 2) = f_{k}^{+}(j) f_{k}^{−}(j),  (84)

where

f_{k}^{±}(j) = \frac{ℓr_{k}(j) ± δ_{k}}{ℓ ± 1} ∈ ℤ,  δ_{k} = (−1)^{⌊^{\frac{k+1}{2}}⌋}.  (85)

Proof. Since δ_{k}^{2} = 1 and r_{k}(j) = (j + 2)^{−1/2} (α^{(2k+1)/2} + α^{−(2k+1)/2}), using α^{1/2} + α^{−1/2} = \sqrt{j + 2} as in (44), it follows that

\begin{aligned}f_{k}^{+}(j) f_{k}^{−}(j) & = & (ℓ^{2}r_{k}(j)^{2} − 1)/(ℓ^{2} − 1) = j^{−1}((j + 2)r_{k}(j)^{2} − 2) \\ & = & ( (α^{(2k+1)/2} + α^{−(2k+1)/2})^{2} − 2)/(α + α^{−1}), \end{aligned}

which coincides with the formula (37) for r_{k}(n) with n = j^{2}−2 = 4ℓ^{4}−8ℓ^{2}+2 in this case. To see that each factor f_{k}^{±}(j) is an integer for all k, note that (S^{2}−jS+1)r_{k}(j) = 0, and checking the sequence of signs +1, −1, −1, +1 for k = 0, 1, 2, 3 shows that (S^{2} − jS + 1)δ_{k} = jδ_{k−1}. Hence the factors in (41) each satisfy an inhomogeneous linear recurrence of second order, that is

f_{k+2}^{±}(j) − j f_{k+1}^{±}(j) + f_{k}^{±}(j) = 2(±ℓ − 1)δ_{k−1}.  (86)

From (85) it can be seen that

f_{−1}^{±}(j) = f_{0}^{±}(j) = 1

provide integer initial values for (86) in each case, so these two sequences consist entirely of integers.

Example 44. For ℓ = 2, the above result gives j = T_{2}(2\sqrt{2}) = 6 and n = T_{2}(6) = 34 , with the sequence ( r_{k}(34) ) = ( f_{k}^{+}(6) f_{k}^{−}(6) ) beginning

1, 33, 1121, 38081, 1293633, …,  (87)

where the factors are

( f_{k}^{+}(6) ) : 1, 3, 19, 113, 657, …, ( f_{k}^{−}(6) ) : 1, 11, 59, 337, 1969, …,  (88)

and these satisfy the inhomogeneous recurrences

\begin{aligned}f_{k+2}^{+}(6) − 6 f_{k+1}^{+}(6) + f_{k}^{+}(6) & = & 2(−1)^{⌊^{\frac{k}{2}}⌋}, \\ f_{k+2}^{−}(6) − 6 f_{k+1}^{−}(6) + f_{k}^{−}(6) & = & 6(−1)^{⌊^{\frac{k}{2}}⌋+1}. \end{aligned}

For the case where n = T_{p}(j) for p odd, the formula (72) can be applied, together with (14), to yield the factorization

r_{k}(T_{p}(j)) = R̃_{k}(j) r_{k}(j),  (89)

where

R̃_{k}(j) = R_{k}(−j) = \frac{r_{(p−1)/2}(T_{2k+1}(j))}{r_{(p−1)/2}(j)}  (90)

satisfies the same recurrence (73) as R_{k}(j).

Example 45. When n = T_{3}(3) = 18, the sequence ( r_{k}(18) ) begins

1, 17, 305, 5473, 98209, 1762289, 31622993, 567451585, …,  (91)

so that ã_{18} = 1 since r_{1}(18) = 17 is prime. By adapting Theorem 37, the terms can be factored as

r_{k}(18) = R̃_{k}(3) r_{k}(3),

where the sequence ( r_{k}(3) ) begins with

1, 2, 5, 13, 34, 89, 233, 610, …,  (92)

and ( R̃_{k}(3) ) is a sequence of rational numbers, starting with

1, \frac{17}{2}, 61, 421, \frac{5777}{2}, 19801, 135721, \frac{1860497}{2}, …,

which satisfies the third order recurrence

R̃_{k+3}(3) − 8 (R̃_{k+2}(3) − R̃_{k+1}(3)) − R̃_{k}(3) = 0.

The prefactors R̃_{k}(3) are integers whenever k ≡ 0 or 2 (mod 3), so r_{k}(3) divides r_{k}(18) for all such k, while the terms of the trisection ( r_{3k+1}(18) ) are all divisible by r_{1}(18), which is the only prime in the sequence ( r_{k}(18) )_{k≥0}.

Having described the situation for even Chebyshev values, and given the above example of an odd Chebyshev value, the analogue of Theorem 38 for ( r_{k}(n) ) can now be stated.

Theorem 46. Let (ã_{n})_{n≥1} be the sequence specified by Definition 2. If n = T_{2}(j) where j = 2(ℓ^{2} − 1) for some ℓ ≥ 2, then ã_{n} = −1. Furthermore, if n = T_{p}(j) for some j ≥ 3 with p an odd prime, then either r_{(p−1)/2}(n) is not prime and ã_{n} = −1, or r_{(p−1)/2}(n) is the only prime in the sequence ( r_{k}(n) )_{k≥0} and ã_{n} = (p − 1)/2.

Proof. For the case n = T_{2}(j), j = 2(ℓ^{2} − 1) with ℓ ≥ 2, note that each factor in (84) is an integer, and r_{0}(T_{2}(j)) = f_{0}^{±}(j) = 1. Now as noted in the proof of Lemma 25, for fixed argument the sequence of Chebyshev polynomials of the first kind is strictly increasing with the index k ≥ 0, so from (74) it follows that ( r_{k}(j) )_{k≥0} is strictly increasing. Thus, from their explicit expressions in (85), both sequences ( f_{k}^{±}(j) ) are strictly increasing as well. Hence, for these values of j, r_{k}(T_{2}(j)) is composite for k ≥ 1. Hence there are no primes in the sequence ( r_{k}(n) )_{k≥0} for any of these even Chebyshev values of n.

When n = T_{p}(j), j ≥ 2 with p an odd prime, there is the factorization (89), with R̃_{k}(j) ∈ ℚ given by (90). Just as for the sequences ( s_{k}(n) ), it is necessary to consider whether k ≡ (p − 1)/2 (mod p) or not. One can show that the analogue of Lemma 27 holds for the sequences ( r_{k}(n) ), n ≥ 3, so that when k ≡ (p − 1)/2 (mod p) the denominator of R̃_{k}(j) divides s_{k}(j); or, by using (14) together with (66), one can write the explicit factorization

r_{k}(T_{p}(j)) = r_{i}(T_{p}(j)) r_{(p−1)/2}(T_{2k+1}(j)) for k = (p − 1)/2 + ip,  (93)

Figure 1: Plot of log log s_{k_{N}} (n) against N for the first 43 primes in the sequence for n = 3.

where both integer factors above are greater than 1 for i > 0. On the other hand, for the case k ≢ (p − 1)/2 (mod p), one can show that the analogue of Lemma 28 also holds for the sequences ( r_{k}(n) ), so in that case the denominator in (90) must divide the numerator; hence R̃_{k}(j) ∈ ℤ and both factors in (89) are integers. Then, similarly to the proof of Lemma 25, setting \sqrt{j + 2} = 2 coshτ for real j ≥ 2 in (74) gives

r_{k}(j) = \frac{cosh((2k + 1)τ)}{coshτ} ⟹ \frac{d}{dτ} r_{k}(j) = \frac{2k sinh((2k + 1)τ)}{coshτ} + \frac{sinh(2kτ)}{cosh^{2}τ} > 0

for k > 0, τ > 0, implying that r_{k}(j) is a strictly increasing function of j for j ≥ 2. Hence R̃_{k}(j) > 1 for j > 2, so when 0 < k ≢ (p − 1)/2 (mod p), both integer factors in (89) are greater than 1. Thus r_{(p−1)/2}(T_{p}(j)) is the only term that can be prime.

6 Appearance of primes for non-Chebyshev values

Theorem 38 says that for the values n = T_{p}(j) with prime p and integer j ≥ 3, the sequence ( s_{k}(n) )_{k≥0} contains at most one prime term, and this can only occur if p is an odd prime, in which case s_{(p−1)/2}(T_{p}(j)) is the only term that may be prime. It seems likely that these cases are exceptional, and for non-Chebyshev values of n one would expect infinitely many prime terms, in line with general heuristic arguments for linear recurrence sequences [9].

Conjecture 47. Let n > 1 be a positive integer. The sequence ( s_{k}(n) )_{k≥0} contains infinitely many primes if and only if n ≠ T_{p}(j) for some prime p and some integer j ≥ 3.

In order to consider the distribution of primes in the sequence ( s_{k}(n) ), it is helpful to introduce some notation. Define a subsequence (k_{N})_{N≥1} of the positive integers by requiring that

s_{k_{N}} (n) = Nth prime term in ( s_{k}(n) )_{k≥0},

and, for fixed n, let

S_{k}(n) = { prime q | q < 4k + 1 } ∪ { prime q | q|Π_{k−1}(n) },

where Π_{k−1}(n) is the product in (69).

Conjecture 48. If n ≥ 3 and n ≠ T_{p}(j) for some prime p and some integer j ≥ 3, then, as N → ∞,

log log s_{k_{N}} (n) ∼ C N,  with C = e^{−γ} log \sqrt{λ},  (94)

where λ = \frac{n+\sqrt{n^{2}−4}}{2}, and γ is the Euler–Mascheroni constant.

The above assertion is analogous to a conjecture of Wagstaff regarding Mersenne primes [31]. If M_{N} is the Nth prime of the form 2^{k} − 1, then the heuristic arguments of Wagstaff suggest that

log log M_{N} ∼ C′ N, with C′ = e^{−γ} log 2.

A very clear exposition of the statistical properties of Mersenne primes, with many plots, can be found on Caldwell’s website [4].^{4} When n is a non-Chebyshev value, a heuristic derivation of the corresponding asymptotics of primes in the sequences ( s_{k}(n) ) can be obtained in a similar way, as we now describe.

By Lemma 26, if s_{k}(n) is prime then 2k + 1 is prime, and by Lemma 28, s_{k}(n) is then coprime to s_{j}(n) for all 1 ≤ j ≤ k − 1, and for large enough k it is also coprime to the discriminant n^{2} − 4, hence it is coprime to Π_{k−1}(n). On the other hand, by Corollary 35, if p = 2k + 1 is prime then s_{k}(n) is coprime to all primes q < 4k + 1: such primes are either primitive divisors of lower terms s_{j}(n) with j < k, or they do not appear as divisors of the sequence at all. Thus no prime q ∈ S_{k}(n) can be a factor of s_{k}(n) when 2k + 1 is prime. Then from the prime number theorem, for k large,

4More specifically, see the page https://primes.utm.edu/notes/faq/NextMersenne.html

Prob(2k + 1 prime) ∼ 2/ log(2k + 1);

and, given that 2k + 1 is prime, the probability that s_{k}(n) is prime is estimated by dividing by the probability that s_{k}(n) is indivisible by primes q that either divide lower terms in the sequence, or are forbidden from being divisors of s_{k}(n) due to Corollary 35, to yield

Prob(s_{k}(n) prime|2k + 1 prime) ∼ \frac{1}{log s_{k}(n)} ∏_{q∈S_{k}(n)} (1 − \frac{1}{q})^{−1}
∼ \frac{1}{k log λ} ∏_{q∈S_{k}(n)} (1 − \frac{1}{q})^{−1} ,

where the latter expression comes from the asymptotics in Proposition 25. By multiplying these two probabilities together, and using the limit

lim_{k→∞} log k_{∏_{q prime} ; q≤k} (1 − \frac{1}{q}) = e^{−γ},

which is one of Mertens’ theorems (see section 22.8 in [14]), gives

lim_{k→∞} log(2k + 1)_{∏_{q prime} ; q<4k+1} (1 − \frac{1}{q}) _{∏_{prime q∈S_{k}(n)} ; q≥4k+1} (1 − \frac{1}{q}) = e^{−γ}

which produces the estimate

|\{prime terms s_{k}(n) for 0 < k ≤ x\}| ∼ \frac{1}{e^{−γ} log \sqrt{λ}} ∑_{k≤x} \frac{1}{k} ∼ C^{−1} log x,

so if s_{k_{N}} (n) is the Nth prime term in the sequence then the formula (94) follows from taking

x = k_{N} ∼ \frac{log s_{k_{N}} (n)}{log λ}.

Numerical evidence for small values of n suggests that the log log plot of the prime terms in the sequence ( s_{k}(n) ) is approximately linear (see e.g., Figure 1 for the case n = 3), and gives some support for the proposed value of C. Moreover, it is expected that the appearance of prime terms should behave like a Poisson process, in complete analogy with Wagstaff’s observations on the sequence of Mersenne primes [31]. The first appendix below contains a list of the indices k for the first probable primes that appear in the sequences ( s_{k}(n) ) for n = 3, 4, 5, 6, and as well as including the log log plots, in each of these cases a linear best fit value of C is found, with the ratio

ρ(n) = \frac{C}{log \sqrt{λ}}

being compared with the value

e^{−γ} ≈ 0.561459

coming from Mertens’ theorem.

An analogous behaviour should be observed in the sequences ( r_{k}(n) ) for positive n.

Conjecture 49. Let n > 2 be a positive integer. The sequence ( r_{k}(n) )_{k≥0} contains infinitely many primes if and only if n ≠ T_{p}(j) for some prime p, where the integer j ≥ 3 takes one of values specified in Theorem 46.

The first few prime terms in the sequence ( r_{k}(3) )_{k≥0} are plotted in Figure 5; for more details see the first appendix.

7 Conclusions

It seems highly likely that Theorem 38 identifies all those values of n ≥ 3 such that the sequence ( s_{k}(n) )_{k≥0} contains at most one prime, and Theorem 46 does the same for ( r_{k}(n) )_{k≥0}. The sequences corresponding to all other values of n should have infinitely many prime terms, but proving this should be at least as difficult as proving that there are infinitely many Mersenne primes. For Lehmer numbers, the most sophisticated results currently available concern primitive divisors [1, 30].

The statistics of prime appearances for non-Chebyshev values of n suggests a close analogy with Mersenne primes. For Mersenne primes, the Lucas-Lehmer test is extremely efficient [3]. The ideas from [24, 25] can be adapted to yield a necessary condition for primality of q = s_{k}(n), which can be tested efficiently, but to provide sufficient conditions requires the use of a Lucas test or one of its generalizations [2, 22], for which the formulae (63) and (64) are useful, since they provide partial factorizations of q ± 1. In future we would like to consider some of the large primes that appear in these sequences, extending the approach that was applied to the case n = 6 in [19].

8 Acknowledgements

ANWH is supported by EPSRC fellowship EP/M004333/1. Some results in sections 3,4 and 5 of this paper were also obtained independently by Bradley Klee, who provided useful suggestions for an early draft, and has developed a graphical calculator application to verify the factorizations in Theorem 37 for particular values of p [17]. We are grateful to David Harvey, Robert Israel, Don Reble, John Roberts, Igor Shparlinski and Neil Sloane for helpful comments. We are also extremely indebted to Hans Havermann, whose extensive numerical computations originally inspired many of the results described here.

Appendix A: Sequences of prime appearances

In order to study the appearance of prime terms when n is a non-Chebyshev value, for some particular small values of n we calculated the possible prime terms q = s_{(p−1)/2}(n) when p = 3, 5, 7, 11, … is an odd prime, and then tested them for primality using the Maple isprime command. This uses a probabilistic test, which excludes certain composite values of q, while remaining q are only pseudoprimes. For all but the largest values of the index k = (p − 1)/2, we also checked the computations with Mathematica’s PrimeQ[q] command, as well as performing a Lucas-Lehmer style test for pseudoprimes of our own, and verified that the answer was the same,

For n = 3, the list of the first 43 values k for which s_{k}(3) appear to be prime is OEIS sequence \underline{A117522}, beginning

2, 3, 5, 6, 8, 9, 15, 18, 20, 23, 26, 30, 35, 39, 56, 156, 176, 251, 306, 308, 431, 548,
680, 2393, 2396, 2925, 3870, 4233, 5345, 6125, 6981, 7224, 9734, 17724, 18389,
22253, 25584, 28001, 40835, 44924, 47411, 70028, 74045.

The (probable) primes s_{k}(3) corresponding to these values of k are listed in sequence \underline{A285992}. The log log plot of these terms is given in Figure 1. The slope of the best fit line for these points is

C = 0.2553739565.

For n = 4, the list of the first 23 values k for which s_{k}(4) appear to be prime is

\begin{matrix}1, 2, 3, 6, 9, 14, 18, 146, 216, 293, 704, 1143, 1530, 1593, 2924, 7163, 9176, 9489, \\ 11531, 39543, 50423, 60720, 62868, \end{matrix}

which are listed in OEIS sequence \underline{A299100}, while the corresponding values s_{k}(4) are given in \underline{A299107}. The log log plot of these terms is given in Figure 2. The best fit line for this set of points has slope

C = 0.5196737962.

For n = 5, the list of the first 24 values k for which s_{k}(5) appear to be prime is

\begin{matrix}2, 3, 5, 6, 8, 9, 15, 18, 23, 53, 114, 194, 564, 575, 585, 2594, 3143, 4578, 4970, \\ 9261, 11508, 13298, 30018, 54993, \end{matrix}

as listed in OEIS sequence \underline{A299101}, with the corresponding values of s_{k}(5) listed as sequence \underline{A299109}. The log log plot of these terms is given in Figure 3. The best fit line for this set of points has slope

C = 0.4568584420.

Figure 3: Plot of log log s_{k_{N}} (n) against N for the first 24 primes in the sequence for n = 5. Figure 4: Plot of log log s_{k_{N}} (n) against N for the first 19 primes in the sequence for n = 6.

Figure 5: Plot of log log r_{k_{N}} (n) against N for the first 31 primes in the sequence for n = 3.

For n = 6, the list of the first 25 values k for which s_{k}(6) appear to be prime is

\begin{matrix}1, 2, 3, 9, 14, 23, 29, 81, 128, 210, 468, 473, 746, 950, 3344, 4043, 4839, 14376, \\ 39521, 64563, 72984, 82899, 84338, 85206, 86121, \end{matrix}

as given in OEIS sequence \underline{A113501}, with the corresponding values of s_{k}(6) given in sequence \underline{A088165} (the prime NSW numbers [19]). In our initial submission of this paper, we obtained the first 19 of these values independently, before we were aware of sequence \underline{A113501}, and made the log log plot of these terms is as in Figure 4. The best fit line for these points has slope

C = 0.5434911190.

Subsequently we found the web page [20], where the last six indices above are listed separately, together with their date of discovery by Weisstein. However, on that page it is stated unequivocally that all of the corresponding numbers s_{k}(6) are prime, whereas presumably the largest of these values were obtained using Mathematica’s probabilistic primality test, so the most that can be claimed is that they are pseudoprimes.

Assuming that the heuristic arguments given in section 6 above are correct, and that the small number of points plotted really gives an accurate picture of the behaviour for large N, the predicted values for the ratio ρ(n) = C/ log \sqrt{λ} in each case are

ρ(3) ≈ 0.530689, ρ(4) ≈ 0.789203, ρ(5) ≈ 0.583174, ρ(6) ≈ 0.616641.

Apart from the case n = 4, all of these values are reasonably close to the number e^{−γ} ≈ 0.561459 obtained from Mertens’ theorem. The value for n = 4 seems anomalous: there are fewer prime terms than predicted in this case. However, it may be unreasonable to expect close agreement with the predicted value, given the rather small number of data points plotted in each case.

One can also consider the prime terms in the sequences ( r_{k}(n) ), n ≥ 3, corresponding to negative values of n in s_{k}(n). The list of the first 31 values k for which r_{k}(3) appear to be prime is

\begin{matrix}1, 2, 3, 5, 6, 8, 11, 14, 21, 23, 41, 65, 68, 179, 215, 216, 224, 254, 284, 285, 1485, \\ 2361, 2693, 4655, 4838, 7215, 12780, 15378, 17999, 18755, 25416. \end{matrix}

Figure 5 is the log log plot of these terms. Note that ( r_{k}(3) ) is a bisection of the Fibonacci sequence, for which the prime terms are listed as OEIS sequence \underline{A005478}. The slope of the best fit line for these points is

C = 0.3409264905.

Dividing this value by log \sqrt{λ} = log ((1 + \sqrt{5})/2) gives

ρ(−3) ≈ 0.708475,

which is rather large compared with the value of e^{−γ} expected from Mertens’ theorem, suggesting that the number of primes in this sequence is initially somewhat lower than would be expected from the heuristic argument in section 6.

Appendix B: Related sequences from the OEIS

Here we briefly mention some other sequences in the OEIS which are related to the considerations in this paper.

Sequence \underline{A294099} contains the array of values s_{k}(n) for n ≥ 1, k ≥ 0, while \underline{A299045} is the array of s_{k}(−n) for the same range of n and k.

Sequence \underline{A002327} consists of primes of the form n^{2} − n − 1, and after sending n → −n this corresponds to prime values of the polynomial s_{2}(n) = n^{2} + n − 1, for which the relevant values of n are given by sequence \underline{A045546}.

Sequence \underline{A000032} begins

2, 1, 3, 4, 7, 11, 18, 29, 47, …,

and consists of the Lucas numbers denoted ℓ_{k}^{+}(1, −1) in section 2, which satisfy the Fibonacci recurrence ℓ_{k+2}^{+}(1, −1) = ℓ_{k+1}^{+}(1, −1) + ℓ_{k}^{+}(1, −1). This coincides with an interlacing of two sequences, namely

T_{0}(3), s_{0}(3), T_{1}(3), s_{1}(3), T_{2}(3), s_{2}(3), T_{3}(3), …,

so its two distinct bisections are ( T_{k}(3) ) and ( s_{k}(3) ), given by \underline{A005248} and \underline{A002878} respectively. Similarly, the Fibonacci sequence \underline{A000045} itself coincides with the interlacing

U_{−1}(3), r_{0}(3), U_{0}(3), r_{1}(3), U_{1}(3), r_{2}(3), U_{2}(3), …

obtained from ( U_{k}(3) ) and ( r_{k}(3) ), given by \underline{A001906} and \underline{A001519} respectively.

There are other values of n for which the OEIS entry for the sequence of terms s_{k}(n) has not been mentioned so far: ( s_{k}(4) )_{k≥0} is \underline{A001834}, ( s_{k}(5) )_{k≥0} is \underline{A030221}, ( s_{k}(7) )_{k≥0} is \underline{A033890}, ( s_{k}(8) )_{k≥0} is \underline{A057080}, and ( s_{k}(9) )_{k≥0} is \underline{A057081}.

\underline{A008865} is the sequence of values of T_{2}(j) for j = 1, 2, 3, …; the array of values T_{k}(n) for k ≥ 1, n ≥ 1 is rendered as sequence \underline{A298675}. The values T_{p}(n) for prime p are listed in sequence \underline{A298878}, while the values T_{p}(n) with p an odd prime which are not also of the form T_{2}(m) for some m are given in \underline{A299071}.

References

[1] Yu. Bilu, G. Hanrot, and P. M. Voutier, Existence of primitive divisors of Lucas and Lehmer numbers, With an appendix by M. Mignotte, J. Reine Angew. Math. 539 (2001), 75–122.

[2] J. Brillhart, D. H. Lehmer, and J. L. Selfridge, New primality criteria and factorizations of 2^{m} ± 1, Math. Comp. 29 (1975), 620–647.

[3] J. W. Bruce, A really trivial proof of the Lucas-Lehmer primality test, Amer. Math. Monthly 100 (1993), 370–371.

[4] C. K. Caldwell, The Prime Pages, http://primes.utm.edu/

[5] R. N. Desmarais and S. R. Bland, Tables of Properties of Airfoil Polynomials, NASA Reference Publication 1343, 1995.

[6] A. Dubickas, A. Novikas, and J. Šiurys, A binary linear recurrence of composite numbers, J. Number Theory 130 (2010), 1737–1749.

[7] P. F. Duvall and J. C. Mortick, Decimation of periodic sequences, SIAM J. Appl. Math. 21 (1971), 367–372.

[8] H. Dym and H. P. McKean, Fourier Series and Integrals, Academic Press, 1972.

[9] G. Everest, A. van der Poorten, I. Shparlinski, and T. Ward, Recurrence Sequences, AMS Mathematical Surveys and Monographs, vol. 104, American Mathematical Society, 2003.

[10] G. Everest, S. Stevens, D. Tamsett, and T. Ward, Primes generated by recurrence sequences, Amer. Math. Monthly 114 (2007), 417–431.

[11] R. L. Graham, A Fibonacci-like sequence of composite integers, Math. Mag. 37 (1964), 322–324.

[12] R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, 2nd edition, Addison-Wesley, 1994.

[13] J. Griffiths, Identities connecting the Chebyshev polynomials, Math. Gaz. 100 (2016), 450–459.

[14] G. H. Hardy and E. M. Wright, Introduction to the Theory of Numbers, 4th edition, Oxford University Press, 1975.

[15] H. Havermann, L. E. Jeffery, B. Klee, D. Reble, R. G. Selcoe, and N. J. A. Sloane,

    Information about A269254, available at https://oeis.org/A269254/a269254.txt .

[16] B. Klee, submission to the SeqFan mailing list, October 2017,

    http://list.seqfan.eu/pipermail/seqfan/2017-October/018016.html.

[17] B. Klee, Factoring the even trigonometric polynomials of \underline{A269254},

    http://demonstrations.wolfram.com/ .

[18] J. C. Mason and D. C. Handscomb, Chebyshev Polynomials, Chapman & Hall/CRC, 2002.

[19] M. Newman, D. Shanks, and H. C. Williams, Simple groups of square order and an interesting sequence of primes, Acta Arith. 38 (1980), 129–140.

[20] NSW Number, http://mathworld.wolfram.com/NSWNumber.html .

[21] F. W. J. Olver, A. B. Olde Daalhuis, D. W. Lozier, B. I. Schneider, R. F. Boisvert, C. W. Clark, B. R. Miller, and B. V. Saunders, eds., NIST Digital Library of Mathematical Functions. Available at http://dlmf.nist.gov/, Release 1.0.17 of 2017-12-22.

[22] C. Pomerance, Primality testing: variations on a theme of Lucas, Congr. Numer. 201 (2010), 301–312.

[23] M. Rayes, V. Trevisan, and P. Wang, Factorization properties of Chebyshev polynomials, Comput. Math. Appl. 50 (2005), 1231–1240.

[24] Ö.J. Rödseth, A note on primality tests for N = h · 2^{n} − 1, BIT 34 (1994), 451–454.

[25] A. Rotkiewicz and R. Wasén, Lehmer’s numbers, Acta Arith. 36 (1980), 203–217.

[26] A. Schinzel, On primitive prime factors of Lehmer numbers I, Acta Arith. 8 (1963), 213–223.

[27] N. J. A. Sloane, The Online Encyclopedia of Integer Sequences, https://oeis.org/ .

[28] L. Somer, Second-order linear recurrences of composite numbers, Fibonacci Quart. 44 (2006), 358–361.

[29] C. L. Stewart, On divisors of Fermat, Fibonacci, Lucas and Lehmer numbers, Proc. Lond. Math. Soc. 35 (1977), 425–447.

[30] C. L. Stewart, On divisors of Lucas and Lehmer numbers, Acta Math. 211 (2013), 291–314.

[31] S. S. Wagstaff, Jr., Divisors of Mersenne numbers, Math. Comp. 40 (1983), 385–397.

[32] M. Ward, The arithmetical theory of linear recurring series, Trans. Amer. Math. Soc. 35 (1933), 600–628.

[33] N. Zierler and W. H. Mills, Products of linear recurring sequences, J. Algebra 27 (1973), 147–157.

2010 Mathematics Subject Classification: Primary 11B83; Secondary 11A51.

Keywords: recurrence sequence, Chebyshev polynomial, composite number, Lehmer number.

(Concerned with sequence \underline{A000032}, \underline{A000045}, \underline{A001519}, \underline{A001834}, \underline{A001906}, \underline{A002315}, \underline{A002327}, \underline{A002878}, \underline{A005248}, \underline{A005478}, \underline{A008865}, \underline{A030221}, \underline{A033890}, \underline{A045546}, \underline{A057080}, \underline{A057081}, \underline{A088165}, \underline{A113501}, \underline{A117522}, \underline{A269251}, \underline{A269252}, \underline{A269253}, \underline{A269254}, \underline{A285992}, \underline{A294099}, \underline{A298675}, \underline{A298677}, \underline{A298878}, \underline{A299045}, \underline{A299071}, \underline{A299100}, \underline{A299101}, \underline{A299107}, and \underline{A299109}.)

Received February 8 2018; revised versions received July 23 2018; July 31 2018; August 2 2018. Published in Journal of Integer Sequences, August 23 2018.

Return to Journal of Integer Sequences home page.