Andrew Granville To Andrzej Schinzel on his 75th birthday, with thanks for the many inspiring papers

Similar documents
PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES

SOLUTIONS TO PROBLEM SET 1. Section = 2 3, 1. n n + 1. k(k + 1) k=1 k(k + 1) + 1 (n + 1)(n + 2) n + 2,

Part II. Number Theory. Year

Summary Slides for MATH 342 June 25, 2018

Zsigmondy s Theorem. Lola Thompson. August 11, Dartmouth College. Lola Thompson (Dartmouth College) Zsigmondy s Theorem August 11, / 1

Fibonacci numbers of the form p a ± p b

arxiv: v2 [math.nt] 29 Jul 2017

Two Diophantine Approaches to the Irreducibility of Certain Trinomials

Rigid Divisibility Sequences Generated by Polynomial Iteration

ABSTRACT. In this note, we find all the solutions of the Diophantine equation x k = y n, 1, y 1, k N, n INTRODUCTION

#A11 INTEGERS 12 (2012) FIBONACCI VARIATIONS OF A CONJECTURE OF POLIGNAC

ODD REPDIGITS TO SMALL BASES ARE NOT PERFECT

EXTENDING A THEOREM OF PILLAI TO QUADRATIC SEQUENCES

198 VOLUME 46/47, NUMBER 3

1. PROOFS THAT THERE ARE INFINITELY MANY PRIMES

Elementary Properties of Cyclotomic Polynomials

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

The Diophantine equation x n = Dy 2 + 1

arxiv: v1 [math.nt] 19 Dec 2018

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Gaussian integers. 1 = a 2 + b 2 = c 2 + d 2.

Using dynamical systems to prove that there are infinitely many primes

Journal of Number Theory

Explicit Methods in Algebraic Number Theory

RECIPES FOR TERNARY DIOPHANTINE EQUATIONS OF SIGNATURE (p, p, k)

Fermat s Last Theorem for Regular Primes

1. Introduction. Let P and Q be non-zero relatively prime integers, α and β (α > β) be the zeros of x 2 P x + Q, and, for n 0, let

3 The language of proof

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

Quasi-reducible Polynomials

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

#A9 INTEGERS 12 (2012) PRIMITIVE PRIME DIVISORS IN ZERO ORBITS OF POLYNOMIALS

PRIME FACTORS OF DYNAMICAL SEQUENCES. Xander Faber and Andrew Granville

IRREDUCIBILITY TESTS IN F p [T ]

Predictive criteria for the representation of primes by binary quadratic forms

4 Linear Recurrence Relations & the Fibonacci Sequence

arxiv:math/ v1 [math.nt] 9 Aug 2004

A Guide to Arithmetic

POLYGONAL-SIERPIŃSKI-RIESEL SEQUENCES WITH TERMS HAVING AT LEAST TWO DISTINCT PRIME DIVISORS

The Impossibility of Certain Types of Carmichael Numbers

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Section X.55. Cyclotomic Extensions

Extend Fermats Small Theorem to r p 1 mod p 3 for divisors r of p ± 1

MAS114: Exercises. October 26, 2018

Partial Sums of Powers of Prime Factors

PELL NUMBERS WHOSE EULER FUNCTION IS A PELL NUMBER. Bernadette Faye and Florian Luca

Roots of Unity, Cyclotomic Polynomials and Applications

Number Theory Solutions Packet

Pacific Journal of Mathematics

LARGE PRIME NUMBERS (32, 42; 4) (32, 24; 2) (32, 20; 1) ( 105, 20; 0).

Oleg Eterevsky St. Petersburg State University, Bibliotechnaya Sq. 2, St. Petersburg, , Russia

THE p-adic VALUATION OF LUCAS SEQUENCES

Winter Camp 2009 Number Theory Tips and Tricks

Cullen Numbers in Binary Recurrent Sequences

GAPS IN BINARY EXPANSIONS OF SOME ARITHMETIC FUNCTIONS, AND THE IRRATIONALITY OF THE EULER CONSTANT

Contest Number Theory

Chapter 8. P-adic numbers. 8.1 Absolute values

THE DENOMINATORS OF POWER SUMS OF ARITHMETIC PROGRESSIONS. Bernd C. Kellner Göppert Weg 5, Göttingen, Germany

M381 Number Theory 2004 Page 1

The primitive root theorem

NOTES ON DIOPHANTINE APPROXIMATION

FACTORING IN QUADRATIC FIELDS. 1. Introduction

Fermat s Little Theorem. Fermat s little theorem is a statement about primes that nearly characterizes them.

On integer solutions to x 2 dy 2 = 1, z 2 2dy 2 = 1

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

Discrete Logarithms. Let s begin by recalling the definitions and a theorem. Let m be a given modulus. Then the finite set

Chris Smyth School of Mathematics and Maxwell Institute for Mathematical Sciences, University of Edinburgh, Edinburgh EH9 3JZ, UK.

On the Prime Divisors of Odd Perfect Numbers

arxiv: v1 [math.nt] 24 Aug 2015

Necessary and Sufficient Conditions for the Central Norm to Equal 2 h in the Simple Continued Fraction Expansion of 2 h c for Any Odd Non-Square c > 1

GENERALIZATIONS OF SOME ZERO-SUM THEOREMS. Sukumar Das Adhikari Harish-Chandra Research Institute, Chhatnag Road, Jhusi, Allahabad , INDIA

SQUARES FROM SUMS OF FIXED POWERS. Mark Bauer and Michael A. Bennett University of Calgary and University of British Columbia, Canada

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Factorization in Integral Domains II

18. Cyclotomic polynomials II

On the Exponential Diophantine Equation a 2x + a x b y + b 2y = c z

ON THE SET OF WIEFERICH PRIMES AND OF ITS COMPLEMENT

On the number of elements with maximal order in the multiplicative group modulo n

arxiv:math/ v1 [math.nt] 9 Feb 1998

ARITHMETIC PROGRESSIONS OF SQUARES, CUBES AND n-th POWERS

Algebraic integers of small discriminant

Beautiful Mathematics

Introduction to Number Theory

Math 314 Course Notes: Brief description

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Notes on Systems of Linear Congruences

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

DIOPHANTINE PROBLEMS, POLYNOMIAL PROBLEMS, & PRIME PROBLEMS. positive ) integer Q how close are you guaranteed to get to the circle with rationals

32 Divisibility Theory in Integral Domains

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

Addition sequences and numerical evaluation of modular forms

ON UNIVERSAL SUMS OF POLYGONAL NUMBERS

p = This is small enough that its primality is easily verified by trial division. A candidate prime above 1000 p of the form p U + 1 is

CALCULATING EXACT CYCLE LENGTHS IN THE GENERALIZED FIBONACCI SEQUENCE MODULO p

ON A THEOREM OF TARTAKOWSKY

O.B. Berrevoets. On Lehmer s problem. Bachelor thesis. Supervisor: Dr J.H. Evertse. Date bachelor exam: 24 juni 2016

Corollary 4.2 (Pepin s Test, 1877). Let F k = 2 2k + 1, the kth Fermat number, where k 1. Then F k is prime iff 3 F k 1

Transcription:

PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES Andrew Granville To Andrzej Schinzel on his 75th birthday, with thanks for the many inspiring papers Abstract. For a class of Lucas sequences { }, we show that if n is a positive integer then has a primitive prime factor which divides to an odd power, except perhaps when n 1, or 6. This has several desirable consequences. 1. Introduction 1a. Repunits and primitive prime factors. The numbers 11, 111 and 1111111111 are known as repunits, that is all of their digits are 1 in base 10. Repunits cannot be squares since they are 3 mod 4, so one might ask whether a product of distinct repunits can ever be a square? We will prove that this cannot happen. A more interesting example is the set of repunits in base, the integers of the form n 1. In this case there is one easily found product of distinct repunits that is a square, namely 3 1 6 1 1 which is 111 111111 10101 10101 in base ; this turns out to be the only example. For a given sequence of integers { } n 0, we define a primitive prime factor of to be a prime p which divides but p x m for 1 m n 1. The Bang-Zsigmondy theorem 189 states that if r > s 1 and r, s 1 then the numbers rn s n r s have a primitive prime factor for each n > 1 except for the case 6 1 1. For various Diophantine applications it would be of interest to determine whether there is a primitive prime factor p of for which p does not divide. As an example of such an application, note that if 1... k is a square where 1 < n 1 < n < < n k and k 1 then a primitive prime factor p of k divides only k in this product and Many thanks are due to Hendrik Lenstra for informing me of his observation that one can determine the value of the Jacobi symbol x m /, where x m m 1, in terms of the inverse of m mod n. He also proved our results for odd n and then we shared several further email exchanges that led to the results discussed in this paper. I would also like to thank Ilan Vardi for the email discussion alluded to herein, and of course NSERC for partially funding this research. 1 Typeset by AMS-TEX

ANDREW GRANVILLE hence must divide k to an even power. Thus if p divides k to only the first power then 1... k cannot be a square. Unfortunately we are unable to prove anything about primitive prime factors dividing only to the first power, but we are able to show that there is a primitive prime factor that divides to an odd power, which is just as good for this particular application. Theorem 1. If r and s are pairwise coprime integers for which divides rs but not 4, then r n s n /r s has a primitive prime factor which divides it to an odd power, for each n > 1 except perhaps for n and n 6. The case n is exceptional if and only if r + s is a square. The case n 6 is exceptional if and only if r rs + s is 3 times a square. In particular n 1 has a primitive prime factor which divides it to an odd power, for all n > 1 except n 6. Also 10 n 1/9 has a primitive prime factor which divides it to an odd power for all n > 1. Corollary 1. Let r n s n /r s where r and s are pairwise coprime integers for which divides rs but not 4. If 1... k is a square where 1 < n 1 < n < < n k and k 1, then either x r + s is a square, or x 3 x 6 x 3r 3 + s 3 is a square. The infinitely many examples of this last case include 3 + 1 3, leading to the solution 3 1 6 1 1, and 74 3 47 3 549 leading to 743 47 3 11 746 47 6 11 309643. Since 3 + 1 3 is the only non-trivial solution in integers to r 3 + 1 t, we have proved that the only example of a product of repunits which equals a square, in any base b with b mod 4, is the one base example 3 1 6 1 1 given already. 1b. Certain Lucas sequences. The numbers r n s n /r s satisfy x 0 0, x 1 1 and the second order linear recurrence + r + s+1 rs for each n 0. These are examples of a Lucas sequence, where { } n 0 is a Lucas sequence if x 0 0, x 1 1 and 1 + b+1 + c for all n 0, for given non-zero, coprime integers b, c. The discriminant of the Lucas sequence is : b + 4c. Carmichael showed in 1913 that if > 0 then has a primitive prime factor for each n 1, or 6 except for F 1 144 where F n is the Fibonacci sequence b c 1, and for F 1 where F n 1 n 1 F n b 1, c 1. We have been able to show the analogy to Theorem 1 for a class of Lucas sequences: Theorem. Let b and c be pairwise coprime integers with c mod 4 and b + 4c > 0. Let { } n 0 be the Lucas sequence satisfying 1. If n 1, or 6 then has a primitive prime factor which exactly divides to an odd power.

PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES 3 In fact x does not have such a prime factor if and only if x b is a square; and x 6 does not have such a prime factor if and only if x 6 /x 3 x b + 3c equals 3 times a square. Theorem 1 is a special case of Theorem since there we have c rs mod 4, b, c r + s, rs 1 and r s > 0. Corollary. Let the Lucas sequence { } n 0 be as in Theorem. If 1... k is a square where 1 < n 1 < n < < n k and k 1 then the product is either x b or x 3 x 6. In fact x 3 x 6 is a square if and only if b and b + 3c are both 3 times a square; that is, there exist odd integers B and C with C, 3B 1 and 4C > 3B 4, for which b 3B and c C 3B 4. 1c. Fermat s last theorem and Catalan s conjecture; and a new observation. Before Wiles work, one studied Fermat s last theorem by considering the equation x p + y p z p for prime exponent p where x, y, z 1, and split into two cases depending on whether p divides xyz. In the first case, in which p xyz, one can factor z p y p into two coprime factors z y and z p y p /z y which must both equal the pth power of an integer. Thus if the pth term of the Lucas sequence x p z p y p /z y is never a pth power for odd primes p then the first case of Fermat s last theorem follows, an approach that has not yet succeeded. However Terjanian [8] did develop these ideas to prove that the first case of Fermat s last theorem is true for even exponents, showing that if x p + y p z p in coprime integers x, y, z where p is an odd prime then p divides either x or y: In any solution, x or y is even, else divides x p + y p z p but not 4, which is impossible. So we may assume that x is even, but not divisible by p, and y and z are odd so that we have a solution r z, s y, t x p to r p s p t with r s 1 mod 4 and t, p. Let r n s n /r s for all n 1, so that x p r s t and x p, r s p, r s p, t 1, which implies that x p is a square. Terjanian s key observation is that the Jacobi symbols xm m for all odd, positive integers m and n. n Thus by selecting m to be an odd quadratic non-residue mod p, we have x m /x p 1 and therefore x p cannot be a square. This contradiction implies that p must divide t, and hence Terjanian s result. A similar method was used earlier by Chao Ko [] in his proof that x 1 y p with p > 3 prime has no non-trivial solutions a first step on the route to proving Catalan s conjecture. Rotkiewicz [4] showed, by these means, that if x p + y p z with x, y 1 then either p divides z or p, z 1, which implies both Terjanian s and Chao Ko s results. Rotkiewicz s key lemma in [4], and then his Theorem in [5], extend : Assume that and b are positive with b, c 1. If b is even and c 1 mod 4 then holds. If 4 divides c, or if b is even and c 1 mod 4 then x m / 1 for all odd, positive integers m, n. In the most interesting case, when, but not 4, divides c, we have xm 3 1 Λm/n for all odd, coprime, positive integers m and n > 1,

4 ANDREW GRANVILLE where Λm/n is the length of the continued fraction for m/n; more precisely, we have a unique representation m/n [a 0, a 1,..., a Λm/n 1 ] where each a i is an integer, with a 0 0, a i 1 for each i 1, and a Λm/n 1. Note that we have not given an explicit evaluation of x m / when b and c are both odd, the most interesting case being b c 1 which yields the Fibonacci numbers. Rotkiewicz [6] does give a complicated formula for determining F m /F n in terms of a special continued fraction type expansion for m/n; it remains to find a simple way to evaluate this formula. To apply 3 we show that one can replace Λm/n mod by the much simpler [u/n] mod, where u is any integer 1/m mod n and that this formula holds for all coprime positive integers m, n. Our proof of this, and the more general 4, is direct see Theorem 3 and Corollary 6 below, though Vardi explained, in email correspondence, how to use the theory of continued fractions to show that Λm/n [u/n] mod see the end of section 5. It is much more difficult to prove that Lucas sequences with negative discriminant have primitive prime factors. Nonetheless, in 1974 Schinzel [7] succeeded in showing that has a primitive prime factor once n > n 0, for some sufficiently large n 0, if 0, other than in the periodic case b ±1, c 1. Determining the smallest possible value of n 0 has required great efforts culminating in the beautiful work of Bilu, Hanrot and Voutier [1] who proved that n 0 30 is best possible. One can easily deduce from Siegel s theorem that if φn > then there are only finitely many Lucas sequences for which does not have a primitive prime factor, and these exceptional cases are all explicitly given in [1]. They show that such examples occur only for n 5, 7, 8, 10, 1, 13, 18, 30: if b 1, c then x 5, x 8, x 1, x 13, x 18, x 30 have no primitive prime factors; if b 1, c 5 then x 7 1; if b, c 3 then x 10 has no primitive prime factors; there are a handful of other examples besides, all with n 1. 1d. Sketches of some proofs. In this subsection we sketch the proof of a special case of Theorem the details will be proved in the next four sections. The reason we focus now on a special case is that this is already sufficiently complicated, and extending the proof to all cases involves some additional and not particularly interesting technicalities, which will be given in section 6. Theorem. Let b and c be integers for which b 3 mod 4, c mod 4, the Jacobi symbol c/b 1 and b + 4c > 0. If { } n 0 is the Lucas sequence satisfying 1 then has a primitive prime factor which exactly divides to an odd power for all n > 1 except perhaps when n 6. This last case occurs if and only if x 6 /3x x 3 is a square. Sketch of the proof of Theorem. Let y n z n where y n is divisible only by primitive prime factors of, and z n is divisible only by imprimitive prime factors of. If every primitive prime factor divides to an even power then y n is a square: it is our goal to show that this is impossible. Compleumber ξ is a primitive nth root of unity if ξ n 1 but ξ m 1 for all 1 m < n. Let φ n t Z[t] be the nth cyclotomic polynomial, that is the monic

PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES 5 polynomial whose roots are the primitive nth roots of unity. Evidently 1 d n φ dx so, by Mobius inversion, we have φ n x d nx d 1 µn/d. Homogenizing, we have r n s n /r s d n, d>1 φ dr, s where φ n r, s : s φn φ n r/s Z[r, s]. Indeed for any Lucas sequence { } the numbers φ n : d n x µn/d d are integers. Most importantly, this definition yields that p is a primitive prime factor of φ n if and only if p is a primitive prime factor of ; moreover p divides both φ n and to the same power. Therefore y n divides φ n, which divides. In fact y n and φ n are very close to each other multiplicatively as we show in Corollaries 3 and 4 below: either φ n y n, or φ n py n where p is some prime dividing n, in this case, n p e m where p is a primitive prime factor of φ m. So if we can show that i φ n is not a square, and ii pφ n is not a square when n is of the form n p e m where p is an odd prime, e 0, m > 1 and m divides p 1, p or p + 1 then we can deduce that y n is not a square. To prove this we modify the approach of Terjanian described above: We will show that there exist integers k and l for which xk xl 1, φ n pφ n where.. is the Jacobi symbol. Our first step then is to evaluate the Jacobi symbol x k /x m for all positive integers m and k. In fact this equals 0 if and only if k, m > 1. Otherwise, we will show that for any coprime positive integers k and m > we have xk 4 1 [u/m] x m for any integer u which is 1/k mod m, as discussed above. Lenstra s observation that 4 holds when x m m 1, which he shared with me in an email, is really the starting point for the proofs of our main results. From this we deduce that xk 1 Nm,u cf φ m for all m 1, where, for rm p m p and the Mobius function µm, we have Nm, u : µ m + #{i : 1 i < urm/m and i, m 1}.

6 ANDREW GRANVILLE Now if φ m is a square then by 5, we have that Nm, u is even whenever u, m 1. In Proposition 4.1 we show that this is false unless m 1, or 6: our proof of this elementary fact is more complicated than one might wish. In Lemma 5.1 we show, using 5, that if pφ m is a square where m p e n, n > 1 and n divides p 1, p or p + 1 then Nm, u Nm, u is even whenever u u mod n with uu, m 1. In Propositions 5. and 5.4 we show that this is false unless m 6: again our proof of this elementary fact is more complicated than one might wish. Since x d 3 mod 4 for all d as may be proved by induction, and since any squarefree integer m has exactly l 1 divisors d > 1, where l is the number of prime factors of m, therefore φ m d m x d x 1 3 3 mod 4, and so cannot be a square. Hence neither φ nor φ 6 is a square despite the fact that x k /φ 6 1 for all k coprime to 6, since N6, u is even whenever u, 6 1. Therefore the only possibility left is that 3φ 6 is a square, as claimed. Proof of Corollary. If p is a primitive prime factor of k, which divides k to an odd power then p does not divide i for any i < k and so divides 1 i k i to an odd power, contradicting the fact that this is a square. Therefore n k or 6 by Theorem. Since a similar argument may be made for any i where n i does does not divide n j with j > i we deduce, from Theorem 1, that every n i must divide 6. Therefore either k 1 and x b is a square, or we can rewrite 1 i k i as a product of 1 j l φ m j times a square, where 1 < m 1 < < m l 6 and {m 1,..., m l 1 } {, 3}. However φ 3 is divisible by some primitive odd prime factor p to an odd power, which does not divide φ 6 as all, n 1 are odd, and so φ 3 cannot be in our product. Now φ 6 is not a square since φ 6 b + 3c 3 mod 4. Therefore both φ and φ 6 are 3 times a square, which is equivalent to x 3 x 6 being a square. Theorem 1 follows from Theorem, and Corollary 1 follows from Corollary.. Elementary properties of Lucas sequences a. Lucas sequences in general. If y n+ by n+1 + cy n for all n 0 with y 0 0, y 1 1 then y n 1 n 1 for all n 0. Therefore the prime factors, and primitive prime factors, of and y n are the same and divide each to the same power, and so we may assume, without loss of generality, that b > 0. Let α and β be the roots of T bt c. Then αn β n α β for all n 0 as may be proved by induction. We note that α + β b and αβ c, so that α, β b, c 1 and thus α, β 1. Moreover α β b + 4c. Lemma 1. We establish various properties of the sequence { }: i We have, c 1 for all n 1. ii We have, +1 1 for all n 0.

PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES 7 iii We have x d+j x d+1 x j mod x d for all d 1 and j 0. Therefore if k l jd. then x k x l x j d+1 mod x d. iv Suppose d is the minimum integer 1 for which x d is divisible by given integer r. Then r x k if and only if d k. v For any two positive integers k and m we have x k, x m x k,m. Proof. i If not, select n minimal so that there exists a prime p with p, c. Then b 1 c 0 mod p and so p 1 since p, b c, b 1, contradicting minimality. ii We proceed by induction using that +1, + + b+1 c, and thus divides, since +1, c 1 by i. Therefore +1, +, +1 1. iii We proceed by induction on j: it is trivially true for j 0 and j 1. For larger j we have x d+j bx d+j 1 + cx d+j x d+1 bx j 1 + cx j x d+1 x j mod x d. iv Since x d+1, x d 1 we see that x d, x d+j x d, x j by iii. So if j is the least positive residue of k mod d we find that r, x k r, x j. Now 0 j d 1 and r, x j r if and only if j 0, and hence d k, so the result follows by the definition of d. v Let g k, m so iv implies that x g x k, x m r, say. Let d be the minimum integer 1 for which x d is divisible by r. Then d k, m g by iv, and thus r x g by iv, and the result is proved. Proposition 1. There exists an integer n 1 for which prime p divides if and only if p does not divide c. In this case let q p if p is odd, and q 4 if p. Select r p to be the minimal integer 1 for which q x rp. Define e p 1 so that p e p x rp but p e p+1 does not. Then q if and only if r p n, in which case, writing n r p p k m where p m for some integer k, we have that p e p+k divides but p e p+k+1 does not. Finally, if p is an odd prime for which p then p x p, and p x p if p > 3. Proof. Since p for some n 1 we have p, αβ, c 1 by Lemma 1i so that p is coprime to both α and β. On the other hand if p, αβ 1 then α, β are in the group of units mod p, and therefore there exists an integer n for which α n 1 β n mod p so that p α n β n. Hence p if p, α β 1. Now p, α β > 1 if and only if p. In this case one easily shows, by induction, that nb/ n 1 mod p if p >, and hence p x p. Finally if and only if b, whence c is odd as b, c 1 and so n mod ; in particular x. Let us write β d α d + β d α d, so that β kd α d + β d α d k α kd + kα k 1d β d α d + k α k d β d α d +..., and therefore, since x d divides x kd, x kd /x d kα k 1d + k α k d β αx d mod x d.

8 ANDREW GRANVILLE We see that if p x d then p x kd /x d if and only if p k, as p, α 1 since α c and p, c 1 by Lemma 1i. We also deduce that x pd /x d pα p 1d mod p, and so p x pd /x d, unless p and x d mod 4. The result then follows from Lemma 1iv. Finally, if odd prime p α β then x p βp α p β α pαp 1 + 1 j p j odd p α p β α +... 0 mod p. Therefore n p p by Lemma 1iv and n p 1 as x 1 1, and so n p p. Adding the two such identities with the roles of α and β exchanged, yields x p p 1 p j 1 α p j + β p j 1 p j xp j. p j p j 1 j p j even This is α p 1 +β p 1 mod p plus 3 if p 3. Now if p > 3 the first term x p /x p 1 and so is not divisible by p. One can verify that 9 x 3 if and only if 9 b + c. Corollary 3. Each φ n is an integer. When p is a primitive prime factor of φ n define n p n. Then p divides both p and φ np to the same power. Otherwise if prime p φ n where n n p then n/n p is a power of p, and p φ n with one possible exception: if p with b odd and c 1 mod 4 then n 3 and φ 6. If p is an odd prime for which p then p φ p but p φ p. Proof. Note first that n p r p when p. We use the formula φ n d n xµn/d d. If n p n then is the only term on the left that is divisible by p, and so p divides both p and φ np to the same power. To determine the power of p dividing φ n we will determine the power of p dividing each x d. To do this we begin by studying those d for which q divides x d in the notation of Proposition 1, and then we return, at the end, to those x d divisible by but not 4: By Proposition 1, q divides x d if and only if d r p p l q with 0 l k and q m, and so the power of p dividing these terms in our product is µp k l e p + l 1 if m 1 and k 1 µm/q 0 if m 0 l k q m e p if m 1 and k 0 i.e. n r p. Hence if p is odd, or p with n r, then p φ n with n > n p if and only if n/n p is a power of p, and then p φ n. Other x d divisible by p occur only in the case that p and r n, and these are the terms x d in the product for which n d but r does not. Such x d are divisible by but not 4. Hence the total power of dividing the product of these terms is 1 if n n d n n d, n d µn/d 1 if n n 0 otherwise

PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES 9 We deduce that φ n with n > n if and only if n/n is a power of. Moreover 4 φ n, except in the special case that n r n and e 3. We now study this special case: We must have c odd, else c is even, so that b is odd, and is odd for all n 1. We must also have b odd, else n mod, so n, that is x b is divisible by but not 4. But then r 4 and so φ 4 b + c mod 4, a contradiction. In this case n 3 and we want r 6. But then φ 3 b + c mod 4, so that c b 1 mod 4, and φ 6 b + 3c 1 + 3 0 mod 4. The last statement follows from the last of Proposition 1 since φ p x p and working through the possibilities when p 3. Since φ n is usually significantly smaller than and since we have a very precise description of the imprimitive prime factors of φ n, it is easier to study primitive prime factors of by studying the factors of φ n Lemma 3. Suppose that p is a prime that does not divide c so that n p exists. Then n p p + 1. Moreover if p > then n p divides p /p. Proof. Proposition 1 implies this when p. We have α b+ / and β b /, which implies that α p bp + p p b + p 1/ b + /p mod p, and analogously β p b /p /. Hence if /p 1 then α p β mod p and β p α mod p, so that α p+1 αα p αβ c mod p and similarly β p+1 c mod p. Now α β, p, p 1 and therefore p x p+1. If /p 1 then α p 1 α 1 α p α 1 α 1 mod p and similarly β p 1 1 mod p, so that p x p 1. In the special case that p we have c is odd. We see easily that if b is even and so then n. If b is odd then n 3 and b + 4c 1 + 4 5 mod 8. Therefore n divides /, with the latter properly interpreted. Corollary 4. Each φ n has at most one imprimitive prime factor, except φ 6 is divisible by 6 if b 3 mod 6 and c 1 mod, and φ 1 is divisible by 6 if b ±1 mod 6 and c 1 mod 6. Proof. Suppose φ n has two imprimitive prime factors p < q. By Corollary 3 we have that q n p and so q n p p + 1 by Lemma 3. Therefore p and q 3, in which case n 3, so that n e 3 for some e 1, and this equals 3 f n 3 for some f 1 by Corollary 3. Thus f 1 and n 3 or 4. The result follows by working through the possibilities mod and mod 3. Corollary 5. Suppose that does not contain a primitive prime factor to an odd power and n 6 or 1. Then either φ n where represents the square of an integer, or φ n p where p is a prime for which p e n with e 1 and n/p e p + 1. Proof. Follows from Corollaries 3 and 4 and Lemma 3.

10 ANDREW GRANVILLE b. Lucas sequences with b, > 0, c/b 1 and b 3 mod 4, c mod 4. As b, > 0 this implies that > 0 for all n 1 since α > β. We also have 3 mod 4 for all n, by induction. In fact + mod 8 for all n 3, which we can prove by induction: We have and x 5 b 4 + 3cb + c 1 + 3c + 4 1 + c b + c x 3 mod 8, x 6 bb 4 + 4cb + 3c b1 + 0 + 4 b1 + 4 bb + c x 4 mod 8. For larger n, we then have + b+1 + c b 1 + c mod 8 by the induction hypothesis. We also note that + b+1 mod c for all n 0, and so b n 1 mod c for all n 1. We deduce from this and the previous paragraph that + b mod 4c for all n 3. Proposition. We have x d+1 /x d 1 for all d 1. Proof. For d 1 this follows as x 1 1; for d we have x 3 /x b + c/b c/b 1. The result then follows from proving that θ d : x d+1 /x d x d /x d 1 1 for all d 3. Since x d+1 cx d 1 mod x d and as x d x d 1 3 mod 4 for d 3, we have θ d cx d 1 /x d x d /x d 1 c/x d c/x d. We will prove that this equals 1 by induction on d 3. So write c δc where C c/. Then note that c δ C δ 1 b + c θ 3 b + c b + c b + c b + c C C δ b δc 1 C which is shown to be 1, by running through the possibilities δ ± and C ±1 mod 4. Also, as c/b 1, c θ 4 bb + c δ C b + c b 1 + c b + c 1 C since δ ± and b + c 5 mod 8. Now for the induction hypothesis, for d 5: The value of θ d c/x d depends only on the square class of x d mod 4c, and we saw in the paragraph above that this is the same square class as x d mod 4c for d 5. Hence θ d 1 for all d 3, and the result follows. 3. Evaluation of Jacobi symbols, when b, > 0, b 3 mod 4, c mod 4 and c/b 1. 3a. The reciprocity law. Suppose that k and m > 1 are coprime positive integers. Let u k,m be the least residue, in absolute value, of 1/k mod m that is u k mod m with m/ < u m/.

PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES 11 Lemma 4. If m, k with m, k 1 then ku k,m + mu m,k 1. Proof. Now v : 1 ku k,m /m is an integer 1/m mod k with k/ + 1/m v < k/ + 1/m. This implies that k/ < v k/, and so v u m,k. Theorem 3. If k 1 and m > 1 are coprime positive integers then the value of the Jacobi symbol x k /x m equals the sign of u k,m. Proof. By induction on k + m 5. Note that when k 1 we have u 1 and the result follows as x 1 /x m 1/x m 1. For larger k, we have two cases. If k > m then let l be the least positive residue of k mod m, say k l jm. By Lemma 1iii we have x k /x m x l /x m x m+1 /x m j x l /x m by Proposition. Moreover u l,m u k,m by definition so that the result follows from the induction hypothesis. If k < m then x k /x m x m /x k since x m x k 3 mod 4. Moreover u k,m and u m,k must have opposite signs, else 1 k u k,m + m u m,k 1 + 1 by Lemma 4 which is impossible. The result follows from the induction hypothesis. Define t m to be the least positive residue of t mod m, so that t m t m[t/m]. Note that 0 t m < m/ if and only if [t m /m/] 0. Also that [t m /m/] [t/m] [t/m] [t/m] mod Now, if m 3 and t, m 1 then t m is not equal to 0 or m/; therefore if u is any integer 1/k mod m then the sign of u k,m is given by 1 [u/m]. We deduce the following from this and Theorem 3: Corollary 6. Suppose that k and m are coprime positive integers. If u is any integer 1/k mod m then 4 xk x m 1 [u/m]. Note that if k is odd then xk x 1, whereas 4 would always give 1. Remark. In email correspondence with Ilan Vardi we understood how 4 can be deduced directly from 3 and known facts about continued fractions. Write p n /q n [a 0, a 1,..., a n ] for each n, and recall that pn p n 1 q n q n 1 a0 1 1 0 a1 1... 1 0 an 1 1 0 as may easily be established by induction on n 1. By taking determinants we see that p n q n 1 p n 1 q n + 1 n+1 1 n+1 mod q n. Taking p n /q n k/m with n Λk/m 1 and u to be the least positive residue of 1/k mod m we see that q n 1 1 n+1 u mod m and q n 1 < q n m, so q n 1 u if n is odd, q n 1 m u if n is even. Now m q n a n q n 1 +q n q n 1 +1, and so q n 1 < m/. Therefore if u < m/ then q n 1 u, so n is odd and the values given in 4 and 3 are equal. A similar argument works if u > m/.

1 ANDREW GRANVILLE 3b. The primitive part. If m, k 1 and u 1/k mod m then 5 xk φ m d m xk x d µm/d 1 Em,u by 4 since x k /x d 1 if d 1 or, where Em, u d m d 3 m µ d [ ] u d 1 j u 1 d m,j d m d 3 m µ d 1 j u 1 d j m µ + µmu 1 + E mod d where E, the contribution when d, occurs only when m is even, and is then equal to µm/u 1, and we can miss the j u term since if d u then d u, m, m. However u is then odd since u, m 1 and so E µm/u 1 0 mod. Now let rn p n p for any integer n. We see that µm/d 0 unless m/d divides rm, that is d is divisible by m/rm, in which case j must be also. Write j im/rm, and each d Dm/rm and so Em, u µm + 1 i< urm m D rm,i which is Nm, u, and so we obtain 5. µrm/d µm + 1 1 i<urm/m i,m1 4. Assuming φ m with m > 1, when b, > 0, b 3 mod 4, c mod 4 and c/b 1. 1 mod, Proposition 4.1. If m 1,, 6 then Nm, u Nm, u is odd for some u, u uu, m 1. Proof. If m is squarefree then Nm, u Nm, u #{i : u i < u and i, m 1}. So, if m is odd and > 1 let u m 1/ and u u + 1. If m is even then there exists a prime q m with q 5 as m or 6, so we can write m qs where q s > 1: Then select u 1 mod s and u 3/ mod q with u u + to get a contradiction. For m not squarefree let m be the largest powerful number dividing m and m m 1 m so that m 1 is squarefree, m 1, m 1, and rm m. Note that m/rm m /rm. When m 4 then Nm, u #{i : 1 i < u, i, m 1}, so if u is the smallest integer > 1 that is coprime with m then Nm, u Nm, 1 1. So we may assume that m > 4, in particular that rm/m /3. Consider m Nm, l + 1 + 1 Nm, l + 1 #{i : l + 1 i l + : i, m 1}. m rm rm with

PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES 13 Select l 1 mod m so that l +, m m. Then we need to select l mod p for m m each prime p dividing m 1 so that each of rm l + 1 + 1, rm l + 1 and l + 1 are coprime to p. Since there are just three linear forms, such congruence classes exist modulo primes p > 3 by the pigeonhole principle; and also for p 3 as may be verified by a case-by-case analysis. Thus the result follows when m 1 is odd. So we may assume that m 1 is even and now consider m Nm, rm l + 1 + 1 Nm, m rm l + 1 #{i : 4l + 1 i 4l + 4 : i, m 1}. Select l 3/4 mod m so that 4l + 3, m m. We can again select l mod p for m m each prime p > 3 dividing m 1 so that each of rm l + 1 + 1, rm l + 1, 4l + 1 are coprime to p by the pigeonhole principle, and therefore the result follows if 3 does not divide m 1. So we may assume that 6 m 1. Select integer l so that l 1 mod m, l m/rm m mod 4 and, for each prime p dividing m 1 /, p does not divide l, rm l 1 or m rm l + 3. Therefore, since 3rm/m 3/5, we have Nm, 1 m rm l + 3 Nm, 1 m rm l 1 #{i : l i < l + 1 : i, m 1} 1. 5. Assuming φ m p with m > 1, when b, > 0, b 3 mod 4, c mod 4 and c/b 1. Lemma 5.1. Suppose that φ m p, where p is an odd prime, m p e n, 1 < n p + 1 and p φ n. If u u mod n with uu, m 1 then Nm, u Nm, u is even. If e 1 and n p then this implies that Nn, u /p Nn, u/p is even. Proof. Let k, k be integers for which k 1/u mod m and k 1/u mod m. Evidently k 1/u 1/u k mod n. If k k mod n then let k k, otherwise take k k + m, so k k mod n since m/n p e is odd. Therefore writing k k + nj we have x k x k x j n+1 mod, by Lemma 1iii; and so x k /p x k /p since p. Therefore since φ m p we have x k /φ m x k /p x k /p x k /φ m and the first result follows from 5. If e 1 then m pn so that rm/m rn/n. Therefore Nm, u Nm, u equals, for U urn/n and U u rn/n, U i<u i,rnp1 1 U i<u i,rn1 1 U i<u i,rn1, p i 1 U/p j<u /p j,rn1 1 mod. since U U mod rn as u u mod n, so that the first term counts each residue class coprime with rn an even number of times, and by writing i jp in the second sum. The result follows. Proposition 5.. Suppose n and n divides p 1 or p + 1 for some odd prime p. Let m p e n for some e 1. There exists an integer u such that uu + n, m 1 for which Nm, u + n Nm, u 1 if e, for which Nn, u + n/p Nn, u/p 1 if e 1, except when p 3, n. In that case we have N 3 e, 3e 1 +4+3 1 e N 3 e, 1 1, for e.

14 ANDREW GRANVILLE Lemma 5.3. If n 3 and odd prime p n 1 or p n + 1 except for the cases n 3 or 6 with p 5; and n 4, p 3 then in any non-closed interval of length n, containing exactly n integers, there exists an integer u for which u and u + n are both prime to np. Proof. Since p n 1 there are no more than three integers, in our two consecutive intervals of length n, that are divisible by p so the result follows when φn 4. Otherwise n 3, 4 or 6, and if the reduced residues are 1 < a < b < n then p divides b a, n + b a, n + a b or n + a b. Therefore p 4, 10, or 8 for n 6; p or 6 for n 4; p 1, 4, or 5 for n 3. The result follows. Proof of Proposition 5.. Let f : max{1, e 1}. The result holds for m, u 3 5 e, 5f 3, 6 5 e, 5f 3, 4 3 e, 3 f, p e, pf j for each e 1 and, in the last case, any prime p > 3, where j is either 1 or 3, chosen so that u is odd. Otherwise we can assume the hypotheses of Lemma 5.3. Now suppose that e. Given an integer l we can select u in the range l m m which is an rm n < u l rm interval of length n such that u and u : u + n are both prime to np, by Lemma 5.3. Therefore Nm, u Nm, u counts the number of integers, coprime with m, in an interval of length λ : nrm/m rn/p e 1. Note that λ n/p p + 1/p < 3 so our interval contains no more than [λ] + 1 3 integers, one of which is l. If λ < we select l 1 mod p and l 1 mod n so that Nm, u Nm, u 1. Otherwise λ so that n rn p e 1 p, and thus n p + 1, e and rn n, that is n is squarefree, and p + 1 n. So select l to be an odd integer for which l mod p and l mod n/ so that l ±, l ± 1 all have common factors with m, and therefore Nm, u Nm, u 1. For e 1 and given integer l we now select u in the range l pn rn n < u l pn rn, and Nn, u /p Nn, u/p counts the number of integers, coprime with n, in an interval of length λ : rn/p. If λ < 1 we select l so that it is coprime with n then we have that Nn, u /p Nn, u/p 1 is odd. If λ 1 we have rn p/, and we know that rn n p ± 1, so that rn and n equal p+1, p 1 or p + 1. If n rn p 1 then n is squarefree and divisible by, and [λ] 1; so we select l 1 mod and l 1 mod n/ so that Nn, u /p Nn, u/p 1. In all the remaining cases, one may check that Nn, n + 1/p Nn, 1/p 1. Proposition 5.4. If m p e+1 where p is an odd prime then N m, pe +1 Nm, 1 1. 6. Other Lucas sequences Proposition 6.1. Assume that and b are positive with b, c 1. For n > 1 odd with

PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES 15 m, n 1 we have the following: xm c b m 1n 1/ if 4 c b+1 1 Λm/n+ m 1 c m 1 b+c 1 n m n c 1 b m 1n 1/ if c mod 4 b c m 1n 1/ if b Proof. For m odd this is the result of Rotkiewicz [5], discussed in section 1c. Note that if c is even then b is odd and is odd for all n 1; and if b is even then c is odd and n mod is odd for all n 1. Thus is odd if and only if n is odd. For m even and n odd we have that m + n is odd and so by Lemma 1iii; and therefore xm xn+1 xm+n x xn+1 xn+ note that n, n + are both odd, so we have yet to determine only x / b/. Suppose that c is even so that b is odd. If 4 c then 1 mod 4 if n is odd so that b/ /b. If c mod 4 and b 1 mod 4 then b/ /b. Now c mod b and so c n 1/ mod b for every odd n. Therefore xm xm+n ; xn+ c n 1/. b The results follow in these cases since Λm + n/n Λm/n as m + n/n 1 + m/n, and Λn + /n 3 as n + /n [1, n 1, ]. If c mod 4 and b 3 mod 4 then 3 mod 4 for all n. Therefore b/ /b for all odd n > 1, and the result follows. Now assume that b is even so that c is odd. As c n 1/ mod [b, 4] for each odd n we have, writing b e B with B odd, e b xn c n 1/ e. c n 1/ c n 1/ B c n 1/ Now if 4 b then c n 1/ mod 8. Finally, if e 1 then c n 1/ 1 mod 8 if n ±1 mod 8, and 5 mod 8 if n ±3 mod 8. Therefore c n. n 1/ The result follows.

16 ANDREW GRANVILLE Corollary 6.. Suppose that c mod 4 and b 1 mod, with n odd, m > 1 and m, n 1. Suppose that mu 1 mod n. If n is a power of prime p then xm φ n If n has at least two distinct prime factors then 1 Nn,u+µn c m 1p 1/. b xm φ n 1 Nn,u+µn. If m is even and > then, for nv 1 mod m, φm 1 Nm,v+µm. Proof. This follows from Proposition 6.1, since d n µn/dd 1 is divisible by 4 except if n > 1 and 4 φn, in which case n p k, p k for an odd prime p, or n or n 4. We also have 1 to the power µn/dλm/d µn/d[u/d] Nn, u + µn mod d n d n where u 1/m mod n comparing 3 and 4. In the third case we use the fact that if d < n then the continued fraction for d/n is that of n/d with a 0 on the front, and vice-versa. Hence Λn/d + Λd/n 1 mod. Hence d m µm/dλd/n d m µm/dλn/d + 1 Nm, v + µm mod. Proof of Theorem. If m is odd and has at least two prime factors, or if m is even, 6, or if m p e where p is an odd prime and c/b p 1/ 1, then we can deduce that y m is not a square, just as we did in the proof of Theorem, by using Corollary 6., and then Propositions 4.1 and 5. with Lemma 5.1. Now suppose that m p e where p is an odd prime and c/b p 1/ 1: If φ m is a square then Corollary 6. yields 1 x m 1 /φ m x m 1 /φ m 1, a contradiction. If pφ m is a square and e then Lemma 5.1 remains valid since k k mod in the proof there, and by Corollary 6. and the result follows from Proposition 5.4. We note that in the other cases with bc even, our argument will not yield such a general result about primitive prime factors:

PRIMITIVE PRIME FACTORS IN SECOND-ORDER LINEAR RECURRENCE SEQUENCES 17 Corollary 6.3. Suppose that 4 c and b 1 mod, with n odd and m, n 1. If n is a power of prime p then xm c m 1p 1/. b φ n Otherwise x m /φ n 1 if n has at least two distinct prime factors; and φ m / 1 if m is even and >. Hence we can prove that φ p k is not a square if 4 c and c/b 1 and p 3 mod 4. Corollary 6.4. Suppose that b is even and c is odd, with n odd and m, n 1. If n is a power of prime p then xm φ n c 1 m p m 1 b+c 1 m 1p 1/ b. p c Otherwise x m /φ n 1 if n has at least two distinct prime factors; and φ m / 1 if m is even and >, except when c 1 mod 4, m is a power of, and n ±3 mod 8. Hence we can prove that φ p k is not a square if b is even and c 3 mod 4, or 4 b with b/c 1 and p 3 mod 4, or b mod 4 and p 5 mod 8, or b mod 4 with b/c 1 and p 3 mod 8, or b mod 4 with b/c 1 and p 7 mod 8 7. Open problems We conjecture that for every non-periodic Lucas sequence { } n 0 there exists an integer n x such that if n n x then has a primitive prime factor that divides it to an odd power. In Theorem we proved this in the special case that > 0 and c mod 4, with n x 7. Proposition 6.1 suggests that our approach is unlikely to yield the analogous result in all other cases where bc. We were unable to give a formula for the Jacobi symbol x m / in general when b and c are odd which includes the interesting case of the Fibonacci numbers which can be used in this context though see [6], and we hope that others will embrace this challenge. References 1. Y. Bilu, G. Hanrot and P. Voutier, Existence primitive divisors of Lucas and Lehmer numbers, J. Reine angew. Math 539 001, 75-1.. Chao Ko, On the diophantine equation x y n +1, xy 0, Sci. Sinica Notes 14 1965, 457-460. 3. P. Ribenboim, The little book of bigger primes, Springer Verlag, New York, 004. 4. A. Rotkiewicz, On the equation x p + y p z, Bull. Acad. Sci. Polonaise 30 198, 11-14. 5. A. Rotkiewicz, Applications of Jacobi s symbol to Lehmer s numbers, Acta Arithm 4 1983, 163-187. 6. A. Rotkiewicz, Problems on Fibonacci numbers and their generalizations, in Fibonacci numbers and their applications Patras, 1984, Math. Appl 8 1986, 41-55.

18 ANDREW GRANVILLE 7. A. Schinzel, Primitive divisors of the expression A n B n in algebraic number fields, J. Reine angew. Math 68/69 1974, 7-33. 8. G. Terjanian, Sur l équation x p + y p z p, C.R. Acad. Sci. Paris 85 1977, 973-975. Département de Mathématiques et statistique, Université de Montréal, CP 618 succ. Centre-Ville, Montréal QC H3C 3J7, Canada E-mail address: andrew@dms.umontreal.ca