Lucas sequence

From testwiki
Jump to navigation Jump to search

Template:Short description Template:Distinguish

In mathematics, the Lucas sequences Un(P,Q) and Vn(P,Q) are certain constant-recursive integer sequences that satisfy the recurrence relation

xn=P⋅xn−1−Q⋅xn−2

where P and Q are fixed integers. Although Un(P,Q) and Vn(P,Q) satisfy the same recurrence relation, they differ on the values of their first two elements and thus differ for subsequent elements as well. Any sequence satisfying this recurrence relation can be represented as a linear combination of the Lucas sequences Un(P,Q) and Vn(P,Q).

More generally, Lucas sequences Un(P,Q) and Vn(P,Q) represent sequences of polynomials in P and Q with integer coefficients.

Famous examples of Lucas sequences include the Fibonacci numbers, Mersenne numbers, Pell numbers, Lucas numbers, Jacobsthal numbers, and a superset of Fermat numbers (see below). Lucas sequences are named after the French mathematician Édouard Lucas.

Recurrence relations

Given two integer parameters P and Q, the Lucas sequences of the first kind Un(P,Q) and of the second kind Vn(P,Q) are defined by the recurrence relations:

U0(P,Q)=0,U1(P,Q)=1,Un(P,Q)=P⋅Un−1(P,Q)−Q⋅Un−2(P,Q) for n>1,

and

V0(P,Q)=2,V1(P,Q)=P,Vn(P,Q)=P⋅Vn−1(P,Q)−Q⋅Vn−2(P,Q) for n>1.

It is not hard to show that for n>0,

Un(P,Q)=P⋅Un−1(P,Q)+Vn−1(P,Q)2,Vn(P,Q)=(P2−4Q)⋅Un−1(P,Q)+P⋅Vn−1(P,Q)2.

The above relations can be stated in matrix form as follows:

[Un(P,Q)Un+1(P,Q)]=[01−QP]⋅[Un−1(P,Q)Un(P,Q)],


[Vn(P,Q)Vn+1(P,Q)]=[01−QP]⋅[Vn−1(P,Q)Vn(P,Q)],


[Un(P,Q)Vn(P,Q)]=[P/21/2(P2−4Q)/2P/2]⋅[Un−1(P,Q)Vn−1(P,Q)].

Initial terms of Lucas sequences Un(P,Q) and Vn(P,Q) are given in the table:

nUn(P,Q)Vn(P,Q)00211P2PP2−2Q3P2−QP3−3PQ4P3−2PQP4−4P2Q+2Q25P4−3P2Q+Q2P5−5P3Q+5PQ26P5−4P3Q+3PQ2P6−6P4Q+9P2Q2−2Q3

Explicit expressions

The characteristic equation of the recurrence relation for Lucas sequences Un(P,Q) and Vn(P,Q) is:

x2−Px+Q=0

It has the discriminant D=P2−4Q and, by the quadratic formula, has the roots:

a=P+D2andb=P−D2.

Thus:

a+b=P,
ab=14(P2−D)=Q,
a−b=D.

Note that the sequence an and the sequence bn also satisfy the recurrence relation. However these might not be integer sequences.

Distinct roots

When D≠0, a and b are distinct and one quickly verifies that

an=Vn+UnD2
bn=Vn−UnD2.

It follows that the terms of Lucas sequences can be expressed in terms of a and b as follows

Un=an−bna−b=an−bnD
Vn=an+bn

Repeated root

The case D=0 occurs exactly when P=2S and Q=S2 for some integer S so that a=b=S. In this case one easily finds that

Un(P,Q)=Un(2S,S2)=nSn−1
Vn(P,Q)=Vn(2S,S2)=2Sn.

Properties

Generating functions

The ordinary generating functions are

∑n≥0Un(P,Q)zn=z1−Pz+Qz2;
∑n≥0Vn(P,Q)zn=2−Pz1−Pz+Qz2.

Pell equations

When Q=±1, the Lucas sequences Un(P,Q) and Vn(P,Q) satisfy certain Pell equations:

Vn(P,1)2−D⋅Un(P,1)2=4,
Vn(P,−1)2−D⋅Un(P,−1)2=4(−1)n.

Relations between sequences with different parameters

  • For any number c, the sequences Un(P′,Q′) and Vn(P′,Q′) with
P′=P+2c
Q′=cP+Q+c2
have the same discriminant as Un(P,Q) and Vn(P,Q):
P'2−4Q′=(P+2c)2−4(cP+Q+c2)=P2−4Q=D.
  • For any number c, we also have
Un(cP,c2Q)=cn−1⋅Un(P,Q),
Vn(cP,c2Q)=cn⋅Vn(P,Q).

Other relations

The terms of Lucas sequences satisfy relations that are generalizations of those between Fibonacci numbers Fn=Un(1,−1) and Lucas numbers Ln=Vn(1,−1). For example:

General case(P,Q)=(1,−1),D=P2−4Q=5DUn=Vn+1−QVn−1=2Vn+1−PVn5Fn=Ln+1+Ln−1=2Ln+1−Ln(1)Vn=Un+1−QUn−1=2Un+1−PUnLn=Fn+1+Fn−1=2Fn+1−Fn(2)Um+n=UnUm+1−QUmUn−1=UmVn−QnUm−nFm+n=FnFm+1+FmFn−1=FmLn−(−1)nFm−n(3)U2n=Un(Un+1−QUn−1)=UnVnF2n=Fn(Fn+1+Fn−1)=FnLn(4)U2n+1=Un+12−QUn2F2n+1=Fn+12+Fn2(5)Vm+n=VmVn−QnVm−n=DUmUn+QnVm−nLm+n=LmLn−(−1)nLm−n=5FmFn+(−1)nLm−n(6)V2n=Vn2−2Qn=DUn2+2QnL2n=Ln2−2(−1)n=5Fn2+2(−1)n(7)Um+n=UmVn+UnVm2Fm+n=FmLn+FnLm2(8)Vm+n=VmVn+DUmUn2Lm+n=LmLn+5FmFn2(9)Vn2−DUn2=4QnLn2−5Fn2=4(−1)n(10)Un2−Un−1Un+1=Qn−1Fn2−Fn−1Fn+1=(−1)n−1(11)Vn2−Vn−1Vn+1=DQn−1Ln2−Ln−1Ln+1=5(−1)n−1(12)2n−1Un=(n1)Pn−1+(n3)Pn−3D+⋯2n−1Fn=(n1)+5(n3)+⋯(13)2n−1Vn=Pn+(n2)Pn−2D+(n4)Pn−4D2+⋯2n−1Ln=1+5(n2)+52(n4)+⋯(14)

Of these, (6) and (7) allow fast calculation of V independent of U in a way analogous to exponentiation by squaring. The relation Vmn=Vm(P=Vn,Q=Qn) (which belongs to the section above, "relations between sequences with different parameters") is also useful for this purpose.[1]

Fast computation

An analog of exponentiation by squaring applied to the matrix that calculates Un(P,Q) and Vn(P,Q) from Un−1(P,Q) and Vn−1(P,Q) allows Template:Tmath-time computation of Un(P,Q) and Vn(P,Q) for large values of n.

Divisibility properties

Among the consequences is that Ukm(P,Q) is a multiple of Um(P,Q), i.e., the sequence (Um(P,Q))m≥1 is a divisibility sequence. This implies, in particular, that Un(P,Q) can be prime only when n is prime. Moreover, if gcd⁡(P,Q)=1, then (Um(P,Q))m≥1 is a strong divisibility sequence.

Other divisibility properties are as follows:[2]

  • If n is an odd multiple of m, then Vm divides Vn.
  • Let N be an integer relatively prime to 2Q. If the smallest positive integer r for which N divides Ur exists, then the set of n for which N divides Un is exactly the set of multiples of r.
  • If P and Q are even, then Un,Vn are always even except U1.
  • If P is odd and Q is even, then Un,Vn are always odd for every n>0.
  • If P is even and Q is odd, then the parity of Un is the same as n and Vn is always even.
  • If P and Q are odd, then Un,Vn are even if and only if n is a multiple of 3.
  • If p is an odd prime, then Up≡(Dp),Vp≡P(modp) (see Legendre symbol).
  • If p is an odd prime which divides P and Q, then p divides Un for every n>1.
  • If p is an odd prime which divides P but not Q, then p divides Un if and only if n is even.
  • If p is an odd prime which divides Q but not P, then p never divides Un for any n>0.
  • If p is an odd prime which divides D but not PQ, then p divides Un if and only if p divides n.
  • If p is an odd prime which does not divide PQD, then p divides Ul, where l=p−(Dp).

The last fact generalizes Fermat's little theorem. These facts are used in the Lucas–Lehmer primality test. Like Fermat's little theorem, the converse of the last fact holds often, but not always; there exist composite numbers n relatively prime to D and dividing Ul, where l=n−(Dn). Such composite numbers are called Lucas pseudoprimes.

A prime factor of a term in a Lucas sequence which does not divide any earlier term in the sequence is called primitive. Carmichael's theorem states that all but finitely many of the terms in a Lucas sequence have a primitive prime factor.[3] Indeed, Carmichael (1913) showed that if D is positive and n is not 1, 2 or 6, then Un has a primitive prime factor. In the case D is negative, a deep result of Bilu, Hanrot, Voutier and Mignotte[4] shows that if n > 30, then Un has a primitive prime factor and determines all cases Un has no primitive prime factor.

Specific names

The Lucas sequences for some values of Template:Math and Template:Math have specific names:

Template:Math : Fibonacci numbers
Template:Math : Lucas numbers
Template:Math : Pell numbers
Template:Math : Pell–Lucas numbers (companion Pell numbers)
Template:Math : Counting numbers
Template:Math : Jacobsthal numbers
Template:Math : Jacobsthal–Lucas numbers
Template:Math : Mersenne numbers Template:Math
Template:Math : Numbers of the form Template:Math, which include the Fermat numbers[3]
Template:Math : The square roots of the square triangular numbers.
Template:Math : Fibonacci polynomials
Template:Math : Lucas polynomials
Template:Math : Chebyshev polynomials of second kind
Template:Math : Chebyshev polynomials of first kind multiplied by 2
Template:Math : Repunits in base Template:Math
Template:Math : Template:Math

Some Lucas sequences have entries in the On-Line Encyclopedia of Integer Sequences:

P Q Un(P,Q) Vn(P,Q)
−1 3 Template:OEIS2C
1 −1 Template:OEIS2C Template:OEIS2C
1 1 Template:OEIS2C Template:OEIS2C
1 2 Template:OEIS2C Template:OEIS2C
2 −1 Template:OEIS2C Template:OEIS2C
2 1 Template:OEIS2C Template:OEIS2C
2 2 Template:OEIS2C
2 3 Template:OEIS2C
2 4 Template:OEIS2C
2 5 Template:OEIS2C
3 −5 Template:OEIS2C Template:OEIS2C
3 −4 Template:OEIS2C Template:OEIS2C
3 −3 Template:OEIS2C Template:OEIS2C
3 −2 Template:OEIS2C Template:OEIS2C
3 −1 Template:OEIS2C Template:OEIS2C
3 1 Template:OEIS2C Template:OEIS2C
3 2 Template:OEIS2C Template:OEIS2C
3 5 Template:OEIS2C
4 −3 Template:OEIS2C Template:OEIS2C
4 −2 Template:OEIS2C
4 −1 Template:OEIS2C Template:OEIS2C
4 1 Template:OEIS2C Template:OEIS2C
4 2 Template:OEIS2C Template:OEIS2C
4 3 Template:OEIS2C Template:OEIS2C
4 4 Template:OEIS2C
5 −3 Template:OEIS2C
5 −2 Template:OEIS2C
5 −1 Template:OEIS2C Template:OEIS2C
5 1 Template:OEIS2C Template:OEIS2C
5 4 Template:OEIS2C Template:OEIS2C
6 1 Template:OEIS2C Template:OEIS2C

Applications

Generalizations

The sequence Vn(P,Q)=an+bn, which is a solution to the recurrence Vn(P,Q)=PVn−1(P,Q)−QVn−2(P,Q) when Template:Tmath and Template:Tmath are the roots of the corresponding quadratic equation Template:Tmath, generalizes to degree Template:Tmath. Specifically, for the recurrence relation Vn(P1,…,Pk)=∑j=1kPjVn−j(P1,…,Pk) with integers Template:Tmath and typically with Template:Tmath, let Template:Tmath be the roots of the corresponding polynomial equation zk−∑j=1kPjzk−j=0. Then Vn(P1,…,Pk)=∑j=1kajn is a sequence of integers satisfying the recurrence, as is evidenced by its ordinary generating function, GP1,…,Pk(z)=∑n=0∞Vn(P1,…,Pk)zn=k−∑j=1k−1(k−j)Pjzj1−∑j=1kPjzj.

Software

  • SageMath implements Un and Vn as functions lucas_number1() and lucas_number2(), respectively.[9]

See also

Notes

Template:Reflist

References