On numbers n dividing the nth term of a linear recurrence

Juan Jose´ Alba Gonzalez´ Instituto de Matem´aticas, Universidad Nacional Autonoma de M´exico, C.P. 58089, Morelia, Michoac´an, M´exico [email protected] Florian Luca Instituto de Matem´aticas, Universidad Nacional Autonoma de M´exico, C.P. 58089, Morelia, Michoac´an, M´exico [email protected] Carl Pomerance Mathematics Department, Dartmouth College, Hanover, NH 03755, USA [email protected] Igor E. Shparlinski Dept. of Computing, Macquarie University Sydney, NSW 2109, Australia [email protected]

Abstract

Here, we give upper and lower bounds on the count of positive n x dividing the nth term of a nondegenerate linearly ≤ recurrent with simple roots.

1 1 Introduction

Let un n 0 be a linear recurrence sequence of integers satisfying a homoge- ≥ neous{ linear}

un+k = a1un+k 1 + + ak 1un+1 + akun, for n =0, 1,..., (1) − − where a ,...,a are integers with a = 0. 1 k k In this paper, we study the set of indices n which divide the corresponding term un; that is, the set:

:= n 1 : n u . Nu { ≥ | n} But first, some background on linear recurrence . To the recurrence (1), we associate its characteristic

m k k 1 σi fu(X) := X a1X − ak 1X ak = (X αi) Z[X], − −− − − − ∈ i=1 where α ,...,α C are the distinct roots of f (X) with multiplicities 1 m ∈ u σ1,...,σm, respectively. It is then well-known that the general term of the recurrence can be expressed as

m n un = Ai(n)αi , for n =0, 1,..., (2) i=1 where A (X) are of degrees at most σ 1 for i =1,...,m, with i i − coefficients in K := Q[α1,...,αm]. We refer to [4] for this and other known facts about linear recurrence sequences. For upper bounds on the distribution of u, the case of a linear recurrence with multiple roots already can pose problemsN (but see below). For example, the sequence of general term u = n2n for all n 0 having characteristic n ≥ polynomial f (X)=(X 2)2 shows that may contain all the positive u − Nu integers. So, we look at the case when fu(X) has only simple roots. In this case, the relation (2) becomes

k n un = Aiαi , for n =0, 1,.... (3) i=1

2 Here, A1,...,Ak are constants in K. We may assume that none of them is zero, since otherwise, a little bit of Galois theory shows that the sequence un n 0 satisfies a linear recurrence of a smaller order. ≥ We remark{ } in passing that there is no real obstruction in reducing to the case of the simple roots. Indeed, let D N be a common denominator of all ∈ the coefficients of all the polynomials Ai(X) for i = 1,...,m. That is, the coefficients of each DAi are algebraic integers. Then

m m Du = DA (0)αn + D(A (n) A (0))αn. n i i i − i i i=1 i=1 If n , then n Du . Since certainly n divides1 the algebraic integer ∈Nu | n m D(A (n) A (0))αn, i − i i i=1 m n it follows that n divides i=1 DAi(0)αi . If this is identically zero (i.e., Ai(0) = 0 for all i = 1,...,m), then we are in an instance similar to the instance of the sequence of general term u = n2n for all n 0 mentioned n ≥ above. In this case, u contains at least a positive proportion of all the positive integers (namely,N all n coprime to D). Otherwise, we may put

m n wn = DAi(0)αi for n =0, 1,.... i=0 A bit of Galois theory shows that w is an integer for all n 0, and the n ≥ sequence wn n 0 satisfies a linear recurrence relation of order ℓ := # 1 { } ≥ { ≤ i m : A (0) = 0 with integer coefficients, which furthermore has only ≤ i } simple roots. Hence, u w, and therefore there is indeed no loss of generality when provingN upper⊆ N bounds in dealing only with linear recurrent sequences with distinct roots. We put ∆ := (α α )2 = disc(f ) (4) u i − j u 1 i

3 for the (nonzero) discriminant of the sequence un n 0, or of the polynomial { } ≥ fu(X). It is known that ∆u is an integer. We also assume that (un)n 0 is ≥ nondegenerate, which means that αi/αj is not a root of 1 for any 1 i < j m. Throughout the remainder of this paper, all linear recurrences≤ have only≤ simple roots and are nondegenerate. When k = 2, u0 = 0, u1 = 1 and gcd(a1, a2) = 1, the sequence un n 0 ≥ is called a Lucas sequence. The formula (3) of its general term is { } αn αn u = 1 − 2 , for n =0, 1,.... (5) n α α 1 − 2 That is, we can take A = 1/(α α ) and A = 1/(α α ) in the 1 1 − 2 2 − 1 − 2 formula of the general term (3). In the case of a Lucas sequence (un)n 0, ≥ the fine structure of the set u has been described in [13] (see the references therein and particularly [6]).N We also note that divisibility of terms of a linear recurrence sequence by arithmetic functions of their index have been studied in [10], see also [9] for the special case of Fibonacci numbers. For a set and a positive x we put (x) = [1, x]. A A A ∩ Throughout the paper, we study upper and lower bounds for the number # (x). In particular, we prove that is of asymptotic density zero. Nu Nu Observe first that if k = 1, then u = Aan holds for all n 0 with n 1 ≥ some integers A = 0 and a1 0, 1 . Its characteristic polynomial is ∈ { ± } ω( a1 ) f (X)= X a . It is easy to see that in this case # (x)= O((log x) | | ), u − 1 Nu where for an integer m 2 we use ω(m) for the number of distinct prime factors of m. So, from now≥ on, we assume that k 2. Note next that for the sequence of general term≥ u = 2n 2 for all n − n 0 having characteristic polynomial fu(X)=(X 1)(X 2), Fermat’s little≥ theorem implies that every prime is in , so that− the Prime− Number Nu Theorem and estimates for the distribution of pseudoprimes2 show that it is possible for the estimate # u(x)=(1+ o(1))x/ log x to hold as x . However, we show that # (xN) cannot have a larger order of magnitude.→ ∞ Nu

Theorem 1. For each k 2, there is a positive constant c0(k) depending only on k such that if the≥ characteristic polynomial of a nondegenerate lin- ear recurrence sequence un n 0 of order k has only simple roots, then the { } ≥ 2A is a n which divides 2n 2. The paper [11] shows that there are few odd compared with primes, while− [8] (unpublished) does the same for even pseudoprimes.

4 estimate x # (x) c (k) Nu ≤ 0 log x holds for x sufficiently large. In case of a Lucas sequence, we have a better bound. To simplify no- tations, for a posititive integer ℓ we define logℓ x iteratively as log1 x := max log x, 1 and for ℓ> 1 as logℓ x := log1(logℓ 1 x). When ℓ = 1 we omit the index{ but} understand that all logarithms are− 1. Let ≥

L(x) := exp log x log2 x . (6) Theorem 2. Assume that un n 0 is a Lucas sequence. Then the inequality { } ≥ x # (x) (7) Nu ≤ L(x)1+o(1) holds as x . →∞ For Lucas sequences, we also have a lower bound on # (x). Nu Theorem 3. There is an absolute positive constant c1 such that if un n 0 { } ≥ is a Lucas sequence, then for large x depending on the sequence un n 0, we { } ≥ have # (x) > xc1 . Nu Throughout the paper, we use x for a large positive real number. We use the Landau symbol O and the Vinogradov symbol with the usual meaning in analytic . The constants implied≪ by them may depend on the sequence un n 0, or only on k. We use c0,c1,... for positive constants { } ≥ which may depend on un n 0. We label such constants increasingly as they { } ≥ appear in the paper.

2 Preliminary results

As in the proof of [4, Theorem 2.6], put

xj Du(x1,...,xk) := det(αi )1 i,j k. ≤ ≤

For a p not dividing ak, let Tu(p) be the maximal nonnegative integer T with the property that

p ∤ max 1, N (D(0, x ,...,x )) . { | K/Q 2 k |} 0 x2,...,x T ≤ k≤ 5 It is known that such T exists. In the above relation, x2,...,xk are integers in [1, T ], and for an element α of K we use NK/Q(α) for the norm of α over Q. Since α1,...,αk are algebraic integers in K, it follows that the numbers NK/Q(D(0, x2,...,xk)) are integers. Observe that Tu(p) = 0 if and only if k = 2 and p is a divisor of ∆u = (α α )2. 1 − 2 More can be said in the case when un n 0 is a Lucas sequence. In this { } ≥ case, we have

N (D (0, x )) = αx2 αx2 2 = ∆ 2 u 2, x =1, 2,.... | K/Q u 2 | | 2 − 1 | | u| | x2 | 2 Thus, if p does not divide the discriminant ∆ = (α α )2 = a2 +4a of u 1 − 2 1 2 the sequence un n 0, then Tu(p) + 1 is in fact the minimal positive integer ≥ ℓ such that p{ u}. This is sometimes called the index of appearance of p | ℓ in un n 0 and is denoted by zu(p). The index of appearance zu(m) can ≥ be{ defined} for composite integers m in the same way as above, namely as the minimal positive integer ℓ such that m u . This exists for all positive | ℓ integers m coprime to a2, and has the important property that m un if and only if z (m) n. For any γ (0, 1), let | u | ∈ = p : T (p)

p max 1, N (D(0, x ,...,x )) . (8) | { | K/Q 2 k |} Tu(p) y 1 x2,...,xk y+1 ≤ ≤ ≤

6 k 1 k 1 There are at most (y + 1) − = O(y − ) possibilities for the (k 1)-tuple (x ,...,x ). For each one of these (k 1)-tuples, we have that − 2 k − N (D(0, x ,...,x )) = exp(O(y)). | K/Q 2 k | Hence, the right hand side in (8) is of size exp(O(yk)). Taking logarithms in the inequality implied by (8), we get that

log p = O(yk).

Tu(p) y ≤

If there are a total of n primes involved in this sum and if pi denotes the ith prime, then n k log pi = O(y ), i=1 k so that in the language of the prime number theorem, θ(pn) y . It follows that p yk and n yk/(k log y), which is what we wanted≪ to prove. n ≪ ≪ The parameter Tu(p) is useful to bound the number of solutions n [1, x] of the congruence u 0 (mod p). For example, the following is [4,∈ n ≡ Theorem 5.11].

Lemma 2. There exists a constant c2(k) depending only on k with the follow- ing property. Suppose that un n 0 is a linearly recurrent sequence of order { } ≥ k satisfying recurrence (1). Suppose that p is a prime coprime to ak∆u. As- sume that there exists a positive integer s such that us is coprime to p. Then for any real x 1 the number of solutions R(x, p) of the congruence ≥ u 0 (mod p) with 1 n x n ≡ ≤ ≤ satisfies the bound x R (x, p) c (k) +1 . u ≤ 2 T (p) u

When un n 0 is a Lucas sequence, we put { } ≥ = p : z (p) pγ . Qu,γ { u ≤ }

The remarks preceding Lemma 1 show that # u,γ(x) = # u,γ(x)+O(1). Hence, Lemma 1 implies the following result. Q P

7 Lemma 3. For x> 1, the estimate

x2γ # (x) Qu,γ ≪ log x holds, where the implied constant depends only on the sequence un n 0. { } ≥ As usual, we denote by Ψ(x, y) the number of integers n x with P (n) ≤ ≤ y. By [1, Corollary to Theorem 3.1], we have the following well-known result.

Lemma 4. For x y > 1, the estimate ≥ Ψ(x, y)= x exp( (1 + o(1))v log v) − where log x v = , log y uniformly in the range y > (log x)2 as long as v . →∞ 3 The proof of Theorem 1

We assume that x is large. We split the set u(x) into several subsets. Let P (n) be the largest prime factor of n and letNy = x1/ log log x. Let

(x) := n x : P (n) y ; N1 { ≤ ≤ } (x) := n x : n (x) and P (n) ; N2 { ≤ ∈ N1 ∈ Pu,1/(k+1)} (x) := (x) 2 (x) . N3 N \ ∪i=1Ni We now bound the cardinalities of each one of the above sets. For (x), by Lemma 4, we obtain N1 x # (x)=Ψ(x, y)= x exp( (1 + o(1))v log v)= o , (9) N1 − log x where log x v = = log log x. log y

Suppose now that n 2(x). Then n = pm, where p = P (n) max y,P (m) . In particular,∈ Np x/m therefore m x/y. Since we also≥ { } ≤ ≤ 8 have p (x/m), Lemma 1 implies that the number of such primes ∈ Pu,1/(k+1) p x/m is O (x/m)k/(k+1) , where the implied constant depends on the ≤ sequence un n0. Summing up the above inequality over all possible values ≥ of m x/y{ , we} get ≤ 1 x/y dt # (x) xk/(k+1) xk/(k+1) N2 ≤ mk/(k+1) ≪ tk/(k+1) 1 m x/y 1 ≤≤ (10) x/y x = ((k + 1)xk/(k+1))t1/(k+1) . 1 ≪ y1/(k+1) Now let n (x). As previously, we write n = pm, where p = P (n) >y. ∈N3 We assume that x (hence, y) is sufficiently large. Hence, m x/p < x/y. Since n , we have that n u , therefore p u . Furthermore,≤ T (p) ∈ Nu | n | n u ≥ p1/(k+1). We fix p and count the number of possibilities for m. To this end, let wℓ ℓ 0 be the sequence defined as wℓ = upℓ for all ℓ 0. This is a ≥ linearly{ } recurrent sequence of order k. We would like to apply≥ Lemma 2 to bound the number of solutions to the congruence

w 0 (mod p), where 1 m x/p. m ≡ ≤ ≤ If the conditions of Lemma 2 are satisfied, then this number denoted by Rw(x/p, p) satisfies

x R (x/p, p) c (k) +1 . w ≤ 2 pT (p) w

Let us check the conditions of Lemma 2. Note first that if α1,...,αk are the p p characteristic roots of un n 0, then α1,...,αk are the characteristic roots { } ≥ of wℓ ℓ 1. Hence, { } ≥ k f (X)= (X αp). w − i i=1 In particular, the term aw,k corresponding to the recurrence wℓ ℓ 1 satisfies p { } ≥ a = a assuming that y > 2. Thus, assuming further that y > a , then w,k k | k| we have that p does not divide ak, therefore p does not divide aw,k either. Next, note that ∆ = (αp αp). w i − j 1 i

p ∆ (α α ) ∆p (mod p). w ≡ i − j ≡ u 1 i ∆ , we then have | u| that p ∤ ∆u, therefore p ∤ ∆w either. So far, we have checked that p does not divide aw,k∆w, which is the first assumption in the statement of Lemma 2. Let us check the next assumption. Note that since p ∤ ∆u, the characteristic polynomial fu(X) of uℓ ℓ 0 has { } ≥ only simple roots modulo p. Since p does not divide the last coefficient ak for the recurrence for un n 0 either, it follows that this sequence is purely { } ≥ periodic modulo p. Let tp be its period modulo p. It is known that tp is coprime to p. In fact, tp is a divisor of the number

lcm [pi 1 : i =1, 2,...,k]. − Choose some n > 0 such that u = 0. Let x be so large such that y > u . 0 n0 | n0 | Since p>y, we have p ∤ un0 . And since gcd(p, tp) = 1, there exists an integer s with sp n (mod t ). Thus, ≡ 0 p w = u u (mod p). s sp ≡ n0

In particular, ws is coprime to p. Hence, for x sufficiently large, the second assumption from Lemma 2 holds for the sequence wℓ ℓ 0. { } ≥ Next we show that Tu(p)= Tw(p). Observe that this number exists (both for the sequence uℓ ℓ 0 and wℓ ℓ 0) because p does not divide ak. Indeed, ≥ ≥ the claimed equality{ } follows easily{ } from the following calculation

pxj xj p Dw(x1,...,xk) = det(αi )1 i,j k (det(αi )) (mod p) ≤ ≤ ≡ D (x ,...,x )p (mod p). ≡ u 1 k 1/(k+1) Since n 3(x), we have that Tw(p)= Tu(p) p . Lemma∈N 2 now guarantees that the number≥ of choices for m once p is fixed is x R (x/p, p) c (k) +1 . w ≤ 2 p1+1/(k+1) 10 To summarize, we have x (x) c (k) +1 N3 ≤ 2 p1+1/(k+1) y p x ≤≤ 1 c (k) π(x)+ x ≤ 2 p1+1/(k+1) y p ≤ ∞ dt c (k) π(x)+ x ≤ 2 t1+1/(k+1) y

Therefore (k + 1)x (x) c (k) π(x)+ O . (11) N3 ≤ 2 y1/(k+1) Comparing (9), (10) and (11), we get that x x # (x) c (k)π(x)+ + O (12) N ≤ 2 exp((1 + o(1))v log v) y1/(k+1) as x , where the implied constant depends on the recurrence un n 0. ≥ By our→ choice ∞ of y as x1/ log log x, the second and third terms on the right{ } side of (12) are both o(π(x)) as x , so we have the theorem. →∞ 4 The proof of Theorem 2

We divide the numbers n (x) into several classes: ∈Nu (i) (x) := n (x): P (n) L(x)1/2 ; N1 { ∈Nu ≤ } (ii) (x) := n (x): P (n) L(x)3 ; N2 { ∈Nu ≥ } (iii) (x) := (x) ( (x) (x)). N3 Nu \ N1 ∪N2 It follows from Lemma 4 that x # (x) Ψ(x, L(x)1/2) N1 ≤ ≤ L(x)1+o(1) as x . →∞ For n u and p n, we have n 0 (mod p) and n 0 (mod z(p)). For p not dividing∈N the discriminant| of the≡ characteristic polynomial≡ for u (and so

11 for p sufficiently large) we have z(p) p 1, so that gcd(p, z(p)) = 1. Thus, the conditions n , p n, and p| sufficiently± large jointly force n 0 ∈ Nu | ≡ (mod pz(p)). Hence, if p is sufficiently large, the number of n u(x) with P (n)= p is at most Ψ(x/pz(p),p) x/pz(p). ∈N Thus, for large x, ≤ x x x # (x) = + . N2 ≤ pz(p) pz(p) pz(p) p>L(x)3 p>L(x)3 p>L(x)3 z(p) L(x) z(p)>L(x) ≤ The first sum on the right has, by Lemma 1, at most L(x)2 terms for x large, each term being smaller than x/L(x)3, so the sum is bounded by x/L(x). The second sum on the right has terms smaller than x/pL(x) and the sum of 1/p is of magnitude log log x, so the contribution here is x/L(x)1+o(1) as 1+o(1) x . Thus, # 2(x) x/L(x) as x . →∞ N ≤ →∞j j+1 For any nonnegative integer j, let Ij = [2 , 2 ). For 3, we cover I := 1/2 3 N j aj [L(x) , L(x) ) by these dyadic intervals, and we define aj via 2 = L(x) . We shall assume the variable j runs over just those integers with Ij not disjoint from I. For any integer k, define j,k as the set of primes p Ij with z(p) I . Note that by Lemma 1 we haveP # 4k. We have ∈ ∈ k Pj,k ≪ x # (x) 1 Ψ ,p N3 ≤ ≤ pz(p) j k p j,k n u(x) j k p j,k ∈P P∈N(n)=p ∈P x , ≤ pz(p)L(x)1/2aj +o(1) j k p ∈Pj,k as x , where we have used Lemma 4 for the last estimate. For k>j/2, we use→∞ the estimate

1 k 1 k 2− 2− pz(p) ≤ p ≤ p p I ∈Pj,k ∈ j for x large. For k j/2, we use the estimate ≤ k 1 4 k j =2 − , pz(p) ≪ 2j2k p ∈Pj,k

12 since there are at most order of magnitude 4k such primes, as noted before. Thus,

1 1 1 j/2 a /2 = + 2− = L(x)− j . pz(p) pz(p) pz(p) ≪ k p j,k k>j/2 p j,k k j/2 p j,k ∈P ∈P ≤ ∈P We conclude that x # 3(x) as x . N ≤ L(x)aj /2+1/2aj +o(1) →∞ j Since the minimum value of t/2+1/(2t) for t> 0 is 1 occuring at t = 1, we conclude that # (x) x/L(x)1+o(1) as x . With our prior estimates N3 ≤ → ∞ for # 1(x) and # 2(x), this completes our proof. ItN is possible thatN using the methods of [3] and [5] a stronger estimate can be made.

5 Proof of Theorem 3

Throughout this section, un n 0 is a Lucas sequence. For any positive real ≥ number y let { } M = lcm [n : n y]. y ≤ a For an odd prime p and an integer a we use for the Legendre symbol p of a with respect to p. We start with the following estimate.

Lemma 5. There exists an absolute constant c3 in (1, 1.9] such that for all large y (depending on the sequence un n 0), we have { } ≥ ∆ # 3 p yc3 : u =1 and z (p) M π(yc3 ), ≤ ≤ p u | y ≫ where the constant implied by the above Vinogradov symbol is absolute.

Proof. We follow a method due to Erd˝os [2]. We write c3 =1+ ρ. By the asymptotic formula for primes in arithmetic progressions,

c3 ∆u 1 y # 3 p yc3 : =1 + o(1) ≤ ≤ p ≥ 2 c log y 3 13 as y (the constant 1/2 can be replaced by 1 if ∆ is a perfect square). →∞ u For such primes, zu(p) p 1. Thus, in order for zu(p) to divide My, it | − c3 suffices that p 1 My. Primes p y that fail this property fall into one of the following− two| classes: ≤

(i) There exists a prime factor q>y of p 1; − (ii) There exists a prime q y such that for some positive integer k we have qk >y and qk p ≤1. | − We deal with the first situation. Then p 1= qa for some prime q>y and − since p yc3 = y1+ρ, we have that a

1 yc3 2 1 − yc3 O 1 1 = O .  a − r − r  φ(a)(log y)2 r y r a ≤ |   Let κ be the implied constant in the above. Summing up over all the possible values of a, we get that the number of primes p yc3 failing (i) above is at ≤ most κyc3 1 c κρyc3 4 , (log y)2 φ(a) ≤ log y 2 a yρ ≤≤ where we used the fact first proved by Landau that the inequality 1 c log t φ(a) ≤ 4 a t ≤ holds with some positive constant c for all t 2. 4 ≥ Suppose now that p yc3 is such that p 1 (mod qk) for some prime power qk > y and q y≤. Let k be the minimal≡ positive integer such that ≤ q qkq >y. Then k k 2 and p 1 (mod qkq ). Furthermore, since p yc3 , ≥ q ≥ ≡ ≤ we get that qkq yc3 , therefore q yc3/2. Varying now the prime q, we get ≤ ≤ that the totality of primes p yc3 failing condition (ii) is at most ≤ c3 c3 y y c3/2 3c3/2 1 < π(y )

14 Thus, as y , the number of primes p yc3 such that both conditions ∆ → ∞ ≤ u = 1 and z (p) M hold is at least p u | y c3 1+ o(1) y 3c3/2 1 c κρ y − . 2c − 4 log y − 3

Taking ρ = max 1/(8c4κ), 0.9 we have c3 1.9 and the coefficient of c3 { } ≤ y / log y above exceeds 1/8 + o(1). Since c3 1.9, the last term above is negligible. This completes the proof. ≤ We are now able to prove Theorem 3. Start with a large composite integer y. Throughout the proof, we write M instead of My. By the Prime Number Theorem, log M = (1+ o(1))y as y . By Lemma 5, there are absolute → ∞ c3 constants c3 > 1 and c5 > 0 such that the number of primes p y with c3 ≤ p 1 (mod ∆u) and zu(p) M is > c5π(y ). Take those that are also ≡ | c3 > y. The number of them exceeds c6π(y ) for large y, where we can take c6 = c5/2. Form squarefree numbers n < M composed solely of these primes. For each of these numbers n, we have

z (n) lcm [p 1 : p n] M. u | − | | a a Thus, n uM . Note that M uM , since if p M, then p y. In particular, | | | ≤ a 1 p y. Since y is composite, it follows that p +1 y. Thus, both p − (p +1) ≤ a 1 ≤ a and p − (p 1) are divisors of M. This argument shows that z (p ) M; − u | hence, M uM . Next note| our positive integers n are coprime to M (because they are built only of primes >y), therefore nM u u . Thus, nM (M 2). | M | nM ∈Nu Now let x be large and let y (log x)/3 +1, (log x)/3 +2 be a composite number. For large x, from∈ {⌊ the estimate⌋ log⌊ M = (1+⌋ o(1))} y as x , it follows easily that the inequality M 2 < x holds for large x. To → ∞ count how many n we can create in this way, observe that since all prime factors of n are less than yc3 , it follows that if n has ℓ prime factors, then the inequality n < M holds provided that yℓc3 < M, which in turn is equivalent to ℓc3 log y < log M. For large y, the above inequality holds provided that we choose y ℓ = +1. 2c log y 3 15 The number of primes we can work with, from what we have said above, c3 c3 exceeds c6π(y ) > c7y / log y, where we can take c7 = c6/(2c3). Say that we have exactly T such primes. The number of choices for n is at least

ℓ T T c3 1 ℓ ℓ c9y c10y > > c y − = c e > e , ℓ ℓ 8 8 for large x, where we can take c =2c c , c =(c 1)/(2c ), and c =2c /3. 8 3 7 9 3 − 3 10 9 Since y > (log x)/3, we get that the inequality

# (x) # (M 2) > ec1 log x = xc1 , Nu ≥ Nu holds with c1 = c10/3 for large values of x, as required.

6 Remarks

If it were known that for all c> 1 the estimate ∆ # 3 p yc : u = 1 and z(p) M π(yc) (13) ≤ ≤ p | y ≫ holds for all sufficiently large y, where the implied constant depends on both un n 0 and c, then a slight refinement of the above arguments shows that ≥ {the} inequality # (x) x1/2+o(1) holds as x . However, proving (13) Nu ≥ → ∞ for very large values of c seems to be a very hard problem. We end with a result showing that it is quite possible for # u(x) to be large under quite mild conditions. Observe that the sequence uN = 2n 2 n − has the property that u1 = 0. Here is a more general version of this fact.

Proposition 1. Let k 2 and un n 0 be a linearly recurrent sequence of ≥ { } ≥ order k satisfying recurrence (1). Assume that there exists a positive integer n0 coprime to ak such that un0 =0. Then

# (x) x/ log x, Nu ≫ where the implied constant depends on the sequence un n 0. { } ≥

Proof. Since n0 is coprime to ak, it follows that un n 0 is purely periodic { } ≥ modulo n . Let t be this period. Now, let be the set of primes p 1 0 n0 Ru ≡ (mod tn0 ) such that fu(X) splits in linear factors modulo p. Alternatively,

16 tn u is the set of primes p such that the polynomial fu(X)(X 0 1) splits in linearR factors modulo p. The set of such primes has a positive density− by the Chebotarev Density theorem. We claim that

= pn : p and p > n ∆ . (14) Su { 0 ∈ Ru 0| u|}⊆Nu The above inclusion finishes the proof of the proposition since then

# (x) # (x/n )+ O(1) x/ log x. Nu ≥ Ru 0 ≫ So, let us suppose that p > n ∆ is in . Then p 1 (mod t ), 0| u| Ru ≡ n0 therefore p =1+ λtn0 for some positive integer λ. Thus, pn0 = n0 + λn0tn0 and since un n 1 is purely periodic with period tn0 modulo n0, we get that { } ≥

upn = un +λn t un 0 (mod n0). (15) 0 0 0 n0 ≡ 0 ≡

Next, observe that since the polynomial fu(X) factors in linear factors mod- p ulo p, we get that αi αi (mod p) for all i = 1,...,k. In particular, pn0 n ≡ α α 0 (mod p) for all i =1,...,k. Since the denominators of the num- i ≡ i bers Ai are divisors of ∆u and p> ∆u , it follows that such denominators are |pn0 | n0 invertible modulo p, therefore Aiαi Aiαi (mod p) for all i = 1,...,k. Summing up these congruences for i =1≡ ,...,k, we get

k k u = A αpn0 A αn0 u 0 (mod p). (16) pn0 i i ≡ i i ≡ n0 ≡ i=1 i=1

From the congruences (15) and (16), we get that both p and n0 divide upn0 , and since p is coprime to n0, we get that pn0 upn0 . This completes the proof of the inclusion (14) and of the proposition. |

The condition that n0 is coprime to ak is not always necessary. The con- clusion of Propositon 1 may hold without this condition like in the example of the sequence of general term

u = 10n 7n 2 5n 1 for all n 0, n − − − ≥ for which we can take n0 = 2. Observe that k = 4,

f (X)=(X 10)(X 7)(X 5)(X 1) u − − − −

17 and n0 is not coprime to a4 = 350, yet one can check that the divisibility relation 2p u holds for all primes− p 11. We do not give further details. | 2p ≥ Let (x) be the set of integers n x with n u and n is not of the Mu ≤ | n form pn0, where p is prime and un0 = 0. It may be that in the situation of Theorem 1, we can get a smaller upper bound for # (x) than for # (x). Mu Nu We can show this in a special case.

Proposition 2. Assume that un n 0 is a linearly recurrent sequence of ≥ order k whose characteristic polynomial{ } splits into distinct linear factors in Z[X]. There is a positive constant c11(k) depending on k such that for all sufficiently large x (depending on the sequence u), we have # (x) Mu ≤ x/L(x)c11(k). Proof. Let y = L(x). We partition (x) into the following subsets: Mu (x) := n (x): P (n) y ; M1 { ∈Mu ≤ } (x) := n (x) : there is a prime p n, p>y, pT (p) kx ; M2 { ∈Mu | ≤ } (x) := (x) ( (x) (x)). M3 Mu \ M1 ∪M2

As in the proof of Theorem 2, we see that Lemma 4 implies that # 1(x) x/L(x)1/2+o(1) as x . M ≤ →∞ As in the proof of Theorem 1, x x # (x) +1 . M2 ≪ pT (p) ≪ pT (p) y

18 Suppose now that n (x). Let p n with pT (p) > kx. Using as ∈ M3 | before the notation tp for the period of u modulo p, as well as the fact that T (p) kt and t p 1 (since f splits in linear factors over Q[X]), we have ≤ p p | − u kx < pT (p) kpt kp2, ≤ p ≤ so that p> √x. Thus, n can have at most 1 prime factor p with pT (p) > kx. So, if n (x), we may assume that n = mp where p> √x, m< √x, and ∈M3 P (m) y. Further, we may assume that um = 0. Since p upm and tp p 1, we have≤ p u . Now the number of prime factors of u is| O(m). Since| − the | m m number of n 3(x) with such a prime p n is O(x/(pT (p))+1) = O(1), we have ∈ M | x # (x) m √xΨ(√x, y)= as x , M3 ≪ ≤ L(x)1/4+o(1) →∞ m<√x P (m) y ≤ using Lemma 4. We conclude that the result holds with c11(k) := min 1/5, 1/(k + 2) , say. { } Finally, we note that for a given non-constant polynomial g(X) Z[X] one can consider the more general set ∈

:= n 1 : g(n) u . Nu,g { ≥ | n} We fix some real y < x1/2 and note that by the Brun sieve (see [7, Theo- rem 2.3]), there are at most log y N x (17) 1 ≪ log x values of n x such that g(n) does not have a prime divisor in the interval [y, x1/2]. We≤ also note that for a prime p not dividing the content of g, the divisibility p g(n) puts n in at most deg g arithmetic progressions. Thus, using Lemma| 2 as it was used in the proof of Theorem 1, the number of other n x with g(n) u can be estimated as ≤ | n

x 1 1/2 N2 1 +1 x + O(x ). ≤ ≪ pTu(p) ≪ pTu(p) p [y,x1/2] n x p [y,x1/2] p [y,x1/2] ∈ pg≤(n) ∈ ∈ | p un | 19 Using Lemma 1 for any γ (0, 1) and the trivial estimate Tu(p) log p, we derive ∈ ≫

kγ 1 γ 1 1 1 1 z z − 2 + . pTu(p) ≤ z Tu(p) ≪ z (log z) log z p [z,2z] p [z,2z] ∈ ∈ Taking γ to satisfy zγ =(z log z)1/(k+1), we obtain 1 1 1/(k+1) (k+2)/(k+1) z− (log z)− . z pTu(p) ≪ p [z,2z] ∈ Summing over dyadic intervals, we now have

1 1/(k+1) (k+2)/(k+1) y− (log y)− . pTu(p) ≪ p [y,x1/2] ∈ Therefore, 1/(k+1) (k+2)/(k+1) 1/2 N xy− (log y)− + x . (18) 2 ≪ Taking, for example, y = (log x)k+1, we obtain from (17) and (18) the esti- mate log log x # (x) N + N x . (19) Nu,g ≤ 1 2 ≪ log x It is certainly an interesting question to bring the bound (19) to the same shape as that of Theorem 1. However, the method of proof of Theorem 1 does not apply due to the possible existence of large prime divisors of g(n).

Acknowledgements

The authors are grateful to Chris Smyth who attracted their attention to the problems considered in this paper. During the preparation of this paper, F. L. was supported in part by grants SEP-CONACyT 79685 and PAPIIT 100508, C. P. was supported in part by NSF grant DMS-1001180 and I. S. was supported in part by ARC grant DP1092835.

20 References

[1] E. R. Canfield, P. Erd˝os and C. Pomerance, ‘On a problem of Op- penheim concerning ‘Factorisatio Numerorum’, J. Number Theory 17 (1983), 1–28.

[2] P. Erd˝os, ‘On the normal number of prime factors of p 1 and some − other related problems concerning Euler’s φ ’, Quart. J. Math. (Oxford Ser.) 6 (1935), 205–213.

[3] P. Erd˝os, F. Luca, and C. Pomerance, ‘On the proportion of numbers coprime to a given integer’, Proceedings of the Anatomy of Integers Conference, Montr´eal, March 2006, J.-M. De Koninck, et al., eds., CRM Proceedings and Lecture Notes, vol. 46 (2008), 47-64.

[4] G. Everest, A. van der Poorten, I. E. Shparlinski and T. Ward, Recur- rence sequences, Mathematical Surveys and Monographs, 104, Amer- ican Mathematical Society, Providence, RI, 2003.

[5] D. Gordon and C. Pomerance, ‘The distribution of Lucas and elliptic pseudoprimes’, Math. Comp. 57 (1991), 825–838.

[6] K. Gy˝ory and C. Smyth, ‘The divisibility of an bn by powers of n’, Integers 10 (2010), 319–334. −

[7] H. Halberstam and H.-E. Richert, Sieve Methods, Academic Press, Lon- don, 1974.

[8] S. Li, ‘On the distribution of even pseudoprimes’, Unpublished Manuscript, 1996.

[9] F. Luca, ‘On positive integers n for which Ω(n) divides Fn’, Fibonacci Quart., 41 (2003), 365–371.

[10] F. Luca and I. E. Shparlinski, ‘Some divisibilities amongst the terms of linear recurrences,’ Abh. Math. Sem. Univ. Hamburg, 46 (2006), 143–156.

[11] C. Pomerance, ‘On the distribution of pseudoprimes’, Math. Comp. 37 (1981), 587–593.

21 [12] H. P. Schlickewei and W. M. Schmidt, ‘The number of solutions of polynomial-exponential equations’, Compositio Math. 120 (2000), 193– 225.

[13] C. Smyth, ‘The terms in Lucas sequences divisible by their indices’, J. Integer Sequences 13 (2010), Article 10.2.4.

22