Lucas sequence explained

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-Q ⋅ xn

where

P

and

Q

are fixed integers. 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:

\begin{align} U0(P,Q)&=0,\\ U1(P,Q)&=1,\\ Un(P,Q)&=P ⋅ Un-1(P,Q)-Q ⋅ Un-2(P,Q)forn>1, \end{align}

and

\begin{align} V0(P,Q)&=2,\\ V1(P,Q)&=P,\\ Vn(P,Q)&=P ⋅ Vn-1(P,Q)-Q ⋅ Vn-2(P,Q)forn>1. \end{align}

It is not hard to show that for

n>0

,
\begin{align} U
n(P,Q)&=P ⋅ Un-1(P,Q)+Vn-1(P,Q)
2

,

\\ V
n(P,Q)&=(P2-4Q) ⋅ Un-1(P,Q)+P ⋅ Vn-1(P,Q)
2

.\end{align}

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

\begin{bmatrix}Un(P,Q)\ Un+1(P,Q)\end{bmatrix}=\begin{bmatrix}0&1\ -Q&P\end{bmatrix} ⋅ \begin{bmatrix}Un-1(P,Q)\ Un(P,Q)\end{bmatrix},


\begin{bmatrix}Vn(P,Q)\ Vn+1(P,Q)\end{bmatrix}=\begin{bmatrix}0&1\ -Q&P\end{bmatrix} ⋅ \begin{bmatrix}Vn-1(P,Q)\ Vn(P,Q)\end{bmatrix},


\begin{bmatrix}Un(P,Q)\ Vn(P,Q)\end{bmatrix}=\begin{bmatrix}P/2&1/2\ (P2-4Q)/2&P/2\end{bmatrix} ⋅ \begin{bmatrix}Un-1(P,Q)\ Vn-1(P,Q)\end{bmatrix}.

Initial terms of Lucas sequences

Un(P,Q)

and

Vn(P,Q)

are given in the table:

\begin{array}{r|l|l} n&Un(P,Q)&Vn(P,Q) \\ \hline 0&0&2 \\ 1&1&P \\ 2&P&{P}2-2Q \\ 3&{P}2-Q&{P}3-3PQ \\ 4&{P}3-2PQ&{P}4-4{P}2Q+2{Q}2\\ 5&{P}4-3{P}2Q+{Q}2&{P}5-5{P}3Q+5P{Q}2\\ 6&{P}5-4{P}3Q+3P{Q}2&{P}6-6{P}4Q+9{P}2{Q}2-2{Q}3\end{array}

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+\sqrt{D
}2\quad\text\quad b = \frac2. \,

Thus:

a+b=P,

ab=

1
4

(P2-D)=Q,

a-b=\sqrt{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\ne0

, a and b are distinct and one quickly verifies that

an=

Vn+Un\sqrt{D
}

bn=

Vn-Un\sqrt{D
}.

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

Un=

an-bn
a-b

=

an-bn
\sqrt{D
}

Vn=an+bn

Repeated root

The case

D=0

occurs exactly when

P=2SandQ=S2

for some integer S so that

a=b=S

. In this case one easily finds that

Un(P,Q)=U

2)
n(2S,S

=nSn-1

Vn(P,Q)=V

2)=2S
n(2S,S

n.

Properties

Generating functions

The ordinary generating functions are

\sumn\ge

n
U
n(P,Q)z

=

z
1-Pz+Qz2

;

\sumn\ge

n
V
n(P,Q)z

=

2-Pz
1-Pz+Qz2

.

Pell equations

When

Q=\pm1

, the Lucas sequences

Un(P,Q)

and

Vn(P,Q)

satisfy certain Pell equations:
2
V
n(P,1)

-D ⋅

2
U
n(P,1)

=4,

2
V
n(P,-1)

-D ⋅

2
U
n(P,-1)

=4(-1)n.

Relations between sequences with different parameters

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.

2Q)
U
n(cP,c

=cn-1 ⋅ Un(P,Q),

2Q)
V
n(cP,c

=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:

\begin{array}{l|l|r} Generalcase&(P,Q)=(1,-1),D=P2-4Q=5 \\ \hline DUn={Vn+1-QVn-1

}=2V_-P V_n & 5F_n = =2L_ - L_ & (1)\\V_n = U_ - Q U_=2U_-PU_n & L_n = F_ + F_=2F_-F_n & (2)\\U_ = U_n U_ - Q U_m U_ = U_mV_n-Q^nU_ & F_ = F_n F_ + F_m F_ =F_mL_n-(-1)^nF_ & (3)\\U_ = U_n (U_ - QU_) = U_n V_n & F_ = F_n (F_ + F_) = F_n L_n & (4)\\U_ = U_^2 - Q U_n^2 & F_ = F_^2 + F_n^2 & (5)\\V_ = V_m V_n - Q^n V_ = D U_m U_n + Q^n V_ & L_ = L_m L_n - (-1)^n L_ = 5 F_m F_n + (-1)^n L_ & (6)\\V_ = V_n^2 - 2Q^n = D U_n^2 + 2Q^n & L_ = L_n^2 - 2(-1)^n = 5 F_n^2 + 2(-1)^n & (7)\\U_ = \frac & F_ = \frac & (8)\\V_=\frac & L_=\frac & (9)\\V_n^2-DU_n^2=4Q^n & L_n^2-5F_n^2=4(-1)^n & (10)\\U_n^2-U_U_=Q^ & F_n^2-F_F_=(-1)^ & (11)\\V_n^2-V_V_=DQ^ & L_n^2-L_L_=5(-1)^ & (12)\\2^U_n=P^+P^D+\cdots & 2^F_n=+5+\cdots & (13)\\2^V_n=P^n+P^D+P^D^2+\cdots & 2^L_n=1+5+5^2+\cdots & (14)\end

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 -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\ge1

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\ge1

is a strong divisibility sequence.

Other divisibility properties are as follows:[2]

Vm

divides

Vn

.

Ur

exists, then the set of n for which N divides

Un

is exactly the set of multiples of r.

Un,Vn

are always even except

U1

.

Un,Vn

are always odd for every

n>0

.

Un

is the same as n and

Vn

is always even.

Un,Vn

are even if and only if n is a multiple of 3.

Up\equiv\left(\tfrac{D}{p}\right),Vp\equivP\pmod{p}

(see Legendre symbol).

Un

for every

n>1

.

Un

if and only if n is even.

Un

for any

n>0

.

Un

if and only if p divides n.

Ul

, where

l=p-\left(\tfrac{D}{p}\right)

.

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-\left(\tfrac{D}{n}\right)

. 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 and have specific names:

: Fibonacci numbers

: Lucas numbers

: Pell numbers

: Pell–Lucas numbers (companion Pell numbers)

: Counting numbers

: Jacobsthal numbers

: Jacobsthal–Lucas numbers

: Mersenne numbers

: Numbers of the form, which include the Fermat numbers[3]

: The square roots of the square triangular numbers.

: Fibonacci polynomials

: Lucas polynomials

: Chebyshev polynomials of second kind

: Chebyshev polynomials of first kind multiplied by 2

: Repunits in base

:

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

P

Q

Un(P,Q)

Vn(P,Q)

−1 3
1 −1
1 1
1 2
2 −1
2 1
2 2
2 3
2 4
2 5
3 −5
3 −4
3 −3
3 −2
3 −1
3 1
3 2
3 5
4 −3
4 −2
4 −1
4 1
4 2
4 3
4 4
5 −3
5 −2
5 −1
5 1
5 4
6 1

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 and are the roots of the corresponding quadratic equation, generalizes to degree . Specifically, for the recurrence relation V_n(P_1, \ldots, P_k) = \sum_^k P_j V_(P_1, \ldots, P_k) with integers and typically with, let be the roots of the corresponding polynomial equation z^k - \sum_^k P_j z^ = 0. Then V_n(P_1, \ldots, P_k) = \sum_^k a_j^n is a sequence of integers satisfying the recurrence, as is evidenced by its ordinary generating function, G_(z) = \sum_^\infty V_n(P_1, \ldots, P_k) z^n = \frac.

Software

Un

and

Vn

as functions lucas_number1 and lucas_number2, respectively.[9]

See also

References

Notes and References

  1. Web site: Atnashev . Pavel . A simpler alternative to Lucas–Lehmer–Riesel primality test . Cryptology ePrint Archive.
  2. For such relations and divisibility properties, see, or .
  3. Yabuta . M . A simple proof of Carmichael's theorem on primitive divisors . Fibonacci Quarterly . 2001 . 39 . 5 . 439–443 . 10.1080/00150517.2001.12428701 . 4 October 2018.
  4. Yuri . Bilu . Guillaume . Hanrot . Paul M. . Voutier . Maurice . Mignotte . Existence of primitive divisors of Lucas and Lehmer numbers . J. Reine Angew. Math. . 2001 . 2001 . 539 . 75–122 . 1863855 . 10.1515/crll.2001.080 . 122969549 .
  5. Web site: Primality Proving 3.2 n+1 tests and the Lucas-Lehmer test . t5k.org.
  6. John Brillhart. Derrick Henry Lehmer. John Selfridge. John Selfridge. New Primality Criteria and Factorizations of 2m ± 1. Mathematics of Computation . 29. 130. April 1975. 620–647. 2005583. 10.1090/S0025-5718-1975-0384673-1. John Brillhart. Derrick Henry Lehmer. free.
  7. P. J. Smith . M. J. J. Lennon . LUC: A new public key system . Proceedings of the Ninth IFIP Int. Symp. On Computer Security . 1993 . 103–117 . 10.1.1.32.1835 .
  8. Book: D. Bleichenbacher . W. Bosma . A. K. Lenstra . Advances in Cryptology — CRYPT0' 95 . Some Remarks on Lucas-Based Cryptosystems . Lecture Notes in Computer Science . 963 . 1995 . 386–396 . 10.1007/3-540-44750-4_31 . 978-3-540-60221-7 . http://www.math.ru.nl/~bosma/pubs/CRYPTO95.pdf. free .
  9. Web site: Combinatorial Functions - Combinatorics . 2023-07-13 . doc.sagemath.org.