Lucas sequence

From HandWiki
Revision as of 18:46, 6 February 2024 by SpringEdit (talk | contribs) (add)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In mathematics, the Lucas sequences [math]\displaystyle{ U_n(P,Q) }[/math] and [math]\displaystyle{ V_n(P, Q) }[/math] are certain constant-recursive integer sequences that satisfy the recurrence relation

[math]\displaystyle{ x_n = P \cdot x_{n - 1} - Q \cdot x_{n - 2} }[/math]

where [math]\displaystyle{ P }[/math] and [math]\displaystyle{ Q }[/math] are fixed integers. Any sequence satisfying this recurrence relation can be represented as a linear combination of the Lucas sequences [math]\displaystyle{ U_n(P, Q) }[/math] and [math]\displaystyle{ V_n(P, Q). }[/math]

More generally, Lucas sequences [math]\displaystyle{ U_n(P, Q) }[/math] and [math]\displaystyle{ V_n(P, Q) }[/math] represent sequences of polynomials in [math]\displaystyle{ P }[/math] and [math]\displaystyle{ Q }[/math] 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 France mathematician Édouard Lucas.

Recurrence relations

Given two integer parameters [math]\displaystyle{ P }[/math] and [math]\displaystyle{ Q }[/math], the Lucas sequences of the first kind [math]\displaystyle{ U_n(P,Q) }[/math] and of the second kind [math]\displaystyle{ V_n(P,Q) }[/math] are defined by the recurrence relations:

[math]\displaystyle{ \begin{align} U_0(P,Q)&=0, \\ U_1(P,Q)&=1, \\ U_n(P,Q)&=P\cdot U_{n-1}(P,Q)-Q\cdot U_{n-2}(P,Q) \mbox{ for }n\gt 1, \end{align} }[/math]

and

[math]\displaystyle{ \begin{align} V_0(P,Q)&=2, \\ V_1(P,Q)&=P, \\ V_n(P,Q)&=P\cdot V_{n-1}(P,Q)-Q\cdot V_{n-2}(P,Q) \mbox{ for }n\gt 1. \end{align} }[/math]

It is not hard to show that for [math]\displaystyle{ n\gt 0 }[/math],

[math]\displaystyle{ \begin{align} U_n(P,Q)&=\frac{P\cdot U_{n-1}(P,Q) + V_{n-1}(P,Q)}{2}, \\ V_n(P,Q)&=\frac{(P^2-4Q)\cdot U_{n-1}(P,Q)+P\cdot V_{n-1}(P,Q)}{2}. \end{align} }[/math]

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

[math]\displaystyle{ \begin{bmatrix} U_n(P,Q)\\ U_{n+1}(P,Q)\end{bmatrix} = \begin{bmatrix} 0 & 1\\ -Q & P\end{bmatrix}\cdot \begin{bmatrix} U_{n-1}(P,Q)\\ U_n(P,Q)\end{bmatrix}, }[/math]


[math]\displaystyle{ \begin{bmatrix} V_n(P,Q)\\ V_{n+1}(P,Q)\end{bmatrix} = \begin{bmatrix} 0 & 1\\ -Q & P\end{bmatrix}\cdot \begin{bmatrix} V_{n-1}(P,Q)\\ V_n(P,Q)\end{bmatrix}, }[/math]


[math]\displaystyle{ \begin{bmatrix} U_n(P,Q)\\ V_n(P,Q)\end{bmatrix} = \begin{bmatrix} P/2 & 1/2\\ (P^2-4Q)/2 & P/2\end{bmatrix}\cdot \begin{bmatrix} U_{n-1}(P,Q)\\ V_{n-1}(P,Q)\end{bmatrix}. }[/math]

Examples

Initial terms of Lucas sequences [math]\displaystyle{ U_n(P,Q) }[/math] and [math]\displaystyle{ V_n(P,Q) }[/math] are given in the table:

[math]\displaystyle{ \begin{array}{r|l|l} n & U_n(P,Q) & V_n(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}^{2}Q+2{Q}^{2} \\ 5 & {P}^{4}-3{P}^{2}Q+{Q}^{2} & {P}^{5}-5{P}^{3}Q+5P{Q}^{2} \\ 6 & {P}^{5}-4{P}^{3}Q+3P{Q}^{2} & {P}^{6}-6{P}^{4}Q+9{P}^{2}{Q}^{2}-2{Q}^{3} \end{array} }[/math]

Explicit expressions

The characteristic equation of the recurrence relation for Lucas sequences [math]\displaystyle{ U_n(P,Q) }[/math] and [math]\displaystyle{ V_n(P,Q) }[/math] is:

[math]\displaystyle{ x^2 - Px + Q=0 \, }[/math]

It has the discriminant [math]\displaystyle{ D = P^2 - 4Q }[/math] and the roots:

[math]\displaystyle{ a = \frac{P+\sqrt{D}}2\quad\text{and}\quad b = \frac{P-\sqrt{D}}2. \, }[/math]

Thus:

[math]\displaystyle{ a + b = P\, , }[/math]
[math]\displaystyle{ a b = \frac{1}{4}(P^2 - D) = Q\, , }[/math]
[math]\displaystyle{ a - b = \sqrt{D}\, . }[/math]

Note that the sequence [math]\displaystyle{ a^n }[/math] and the sequence [math]\displaystyle{ b^n }[/math] also satisfy the recurrence relation. However these might not be integer sequences.

Distinct roots

When [math]\displaystyle{ D\ne 0 }[/math], a and b are distinct and one quickly verifies that

[math]\displaystyle{ a^n = \frac{V_n + U_n \sqrt{D}}{2} }[/math]
[math]\displaystyle{ b^n = \frac{V_n - U_n \sqrt{D}}{2}. }[/math]

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

[math]\displaystyle{ U_n = \frac{a^n-b^n}{a-b} = \frac{a^n-b^n}{ \sqrt{D}} }[/math]
[math]\displaystyle{ V_n = a^n+b^n \, }[/math]

Repeated root

The case [math]\displaystyle{ D=0 }[/math] occurs exactly when [math]\displaystyle{ P=2S \text{ and }Q=S^2 }[/math] for some integer S so that [math]\displaystyle{ a=b=S }[/math]. In this case one easily finds that

[math]\displaystyle{ U_n(P,Q)=U_n(2S,S^2) = nS^{n-1}\, }[/math]
[math]\displaystyle{ V_n(P,Q)=V_n(2S,S^2)=2S^n.\, }[/math]

Properties

Generating functions

The ordinary generating functions are

[math]\displaystyle{ \sum_{n\ge 0} U_n(P,Q)z^n = \frac{z}{1-Pz+Qz^2}; }[/math]
[math]\displaystyle{ \sum_{n\ge 0} V_n(P,Q)z^n = \frac{2-Pz}{1-Pz+Qz^2}. }[/math]

Pell equations

When [math]\displaystyle{ Q=\pm 1 }[/math], the Lucas sequences [math]\displaystyle{ U_n(P, Q) }[/math] and [math]\displaystyle{ V_n(P, Q) }[/math] satisfy certain Pell equations:

[math]\displaystyle{ V_n(P,1)^2 - D\cdot U_n(P,1)^2 = 4, }[/math]
[math]\displaystyle{ V_{2n}(P,-1)^2 - D\cdot U_{2n}(P,-1)^2 = 4, }[/math]
[math]\displaystyle{ V_{2n+1}(P,-1)^2 - D\cdot U_{2n+1}(P,-1)^2 = -4. }[/math]

Relations between sequences with different parameters

  • For any number c, the sequences [math]\displaystyle{ U_n(P', Q') }[/math] and [math]\displaystyle{ V_n(P', Q') }[/math] with
[math]\displaystyle{ P' = P + 2c }[/math]
[math]\displaystyle{ Q' = cP + Q + c^2 }[/math]
have the same discriminant as [math]\displaystyle{ U_n(P, Q) }[/math] and [math]\displaystyle{ V_n(P, Q) }[/math]:
[math]\displaystyle{ P'^2 - 4Q' = (P+2c)^2 - 4(cP + Q + c^2) = P^2 - 4Q = D. }[/math]
  • For any number c, we also have
[math]\displaystyle{ U_n(cP,c^2Q) = c^{n-1}\cdot U_n(P,Q), }[/math]
[math]\displaystyle{ V_n(cP,c^2Q) = c^n\cdot V_n(P,Q). }[/math]

Other relations

The terms of Lucas sequences satisfy relations that are generalizations of those between Fibonacci numbers [math]\displaystyle{ F_n=U_n(1,-1) }[/math] and Lucas numbers [math]\displaystyle{ L_n=V_n(1,-1) }[/math]. For example:

[math]\displaystyle{ \begin{array}{r|l} \text{General case} & (P,Q) = (1,-1) \\ \hline (P^2-4Q) U_n = {V_{n+1} - Q V_{n-1}}=2V_{n+1}-P V_n & 5F_n = {L_{n+1} + L_{n-1}}=2L_{n+1} - L_{n} \\ V_n = U_{n+1} - Q U_{n-1}=2U_{n+1}-PU_n & L_n = F_{n+1} + F_{n-1}=2F_{n+1}-F_n \\ U_{2n} = U_n V_n & F_{2n} = F_n L_n \\ V_{2n} = V_n^2 - 2Q^n & L_{2n} = L_n^2 - 2(-1)^n \\ U_{m+n} = U_n U_{m+1} - Q U_m U_{n-1}=\frac{U_mV_n+U_nV_m}{2} & F_{m+n} = F_n F_{m+1} + F_m F_{n-1}=\frac{F_mL_n+F_nL_m}{2} \\ V_{m+n} = V_m V_n - Q^n V_{m-n} = D U_m U_n + Q^n V_{m-n} & L_{m+n} = L_m L_n - (-1)^n L_{m-n} = 5 F_m F_n + (-1)^n L_{m-n} \\ V_n^2-DU_n^2=4Q^n & L_n^2-5F_n^2=4(-1)^n \\ U_n^2-U_{n-1}U_{n+1}=Q^{n-1} & F_n^2-F_{n-1}F_{n+1}=(-1)^{n-1} \\ V_n^2-V_{n-1}V_{n+1}=DQ^{n-1} & L_n^2-L_{n-1}L_{n+1}=5(-1)^{n-1} \\ DU_n=V_{n+1}-QV_{n-1} & F_n=\frac{L_{n+1}+L_{n-1}}{5} \\ V_{m+n}=\frac{V_mV_n+DU_mU_n}{2} & L_{m+n}=\frac{L_mL_n+5F_mF_n}{2} \\ U_{m+n}=U_mV_n-Q^nU_{m-n} & F_{n+m}=F_mL_n-(-1)^nF_{m-n} \\ 2^{n-1}U_n={n \choose 1}P^{n-1}+{n \choose 3}P^{n-3}D+\cdots & 2^{n-1}F_n={n \choose 1}+5{n \choose 3}+\cdots \\ 2^{n-1}V_n=P^n+{n \choose 2}P^{n-2}D+{n \choose 4}P^{n-4}D^2+\cdots & 2^{n-1}L_n=1+5{n \choose 2}+5^2{n \choose 4}+\cdots \end{array} }[/math]

Divisibility properties

Among the consequences is that [math]\displaystyle{ U_{km}(P,Q) }[/math] is a multiple of [math]\displaystyle{ U_m(P,Q) }[/math], i.e., the sequence [math]\displaystyle{ (U_m(P,Q))_{m\ge1} }[/math] is a divisibility sequence. This implies, in particular, that [math]\displaystyle{ U_n(P,Q) }[/math] can be prime only when n is prime. Another consequence is an analog of exponentiation by squaring that allows fast computation of [math]\displaystyle{ U_n(P,Q) }[/math] for large values of n. Moreover, if [math]\displaystyle{ \gcd(P,Q)=1 }[/math], then [math]\displaystyle{ (U_m(P,Q))_{m\ge1} }[/math] is a strong divisibility sequence.

Other divisibility properties are as follows:[1]

  • If [math]\displaystyle{ n \mid m }[/math] is odd, then [math]\displaystyle{ V_m }[/math] divides [math]\displaystyle{ V_n }[/math].
  • Let N be an integer relatively prime to 2Q. If the smallest positive integer r for which N divides [math]\displaystyle{ U_r }[/math] exists, then the set of n for which N divides [math]\displaystyle{ U_n }[/math] is exactly the set of multiples of r.
  • If P and Q are even, then [math]\displaystyle{ U_n, V_n }[/math] are always even except [math]\displaystyle{ U_1 }[/math].
  • If P is even and Q is odd, then the parity of [math]\displaystyle{ U_n }[/math] is the same as n and [math]\displaystyle{ V_n }[/math] is always even.
  • If P is odd and Q is even, then [math]\displaystyle{ U_n, V_n }[/math] are always odd for [math]\displaystyle{ n=1, 2, \ldots }[/math].
  • If P and Q are odd, then [math]\displaystyle{ U_n, V_n }[/math] are even if and only if n is a multiple of 3.
  • If p is an odd prime, then [math]\displaystyle{ U_p\equiv\left(\tfrac{D}{p}\right), V_p\equiv P\pmod{p} }[/math] (see Legendre symbol).
  • If p is an odd prime and divides P and Q, then p divides [math]\displaystyle{ U_n }[/math] for every [math]\displaystyle{ n\gt 1 }[/math].
  • If p is an odd prime and divides P but not Q, then p divides [math]\displaystyle{ U_n }[/math] if and only if n is even.
  • If p is an odd prime and divides not P but Q, then p never divides [math]\displaystyle{ U_n }[/math] for [math]\displaystyle{ n=1, 2, \ldots }[/math].
  • If p is an odd prime and divides not PQ but D, then p divides [math]\displaystyle{ U_n }[/math] if and only if p divides n.
  • If p is an odd prime and does not divide PQD, then p divides [math]\displaystyle{ U_l }[/math], where [math]\displaystyle{ l=p-\left(\tfrac{D}{p}\right) }[/math].

The last fact generalizes Fermat's little theorem. These facts are used in the Lucas–Lehmer primality test. The converse of the last fact does not hold, as the converse of Fermat's little theorem does not hold. There exists a composite n relatively prime to D and dividing [math]\displaystyle{ U_l }[/math], where [math]\displaystyle{ l=n-\left(\tfrac{D}{n}\right) }[/math]. Such a composite is called a Lucas pseudoprime.

A prime factor of a term in a Lucas sequence that 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.[2] Indeed, Carmichael (1913) showed that if D is positive and n is not 1, 2 or 6, then [math]\displaystyle{ U_n }[/math] has a primitive prime factor. In the case D is negative, a deep result of Bilu, Hanrot, Voutier and Mignotte[3] shows that if n > 30, then [math]\displaystyle{ U_n }[/math] has a primitive prime factor and determines all cases [math]\displaystyle{ U_n }[/math] has no primitive prime factor.

Specific names

The Lucas sequences for some values of P and Q have specific names:

Un(1, −1) : Fibonacci numbers
Vn(1, −1) : Lucas numbers
Un(2, −1) : Pell numbers
Vn(2, −1) : Pell–Lucas numbers (companion Pell numbers)
Un(1, −2) : Jacobsthal numbers
Vn(1, −2) : Jacobsthal–Lucas numbers
Un(3, 2) : Mersenne numbers 2n − 1
Vn(3, 2) : Numbers of the form 2n + 1, which include the Fermat numbers[2]
Un(6, 1) : The square roots of the square triangular numbers.
Un(x, −1) : Fibonacci polynomials
Vn(x, −1) : Lucas polynomials
Un(2x, 1) : Chebyshev polynomials of second kind
Vn(2x, 1) : Chebyshev polynomials of first kind multiplied by 2
Un(x+1, x) : Repunits in base x
Vn(x+1, x) : xn + 1

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

[math]\displaystyle{ P\, }[/math] [math]\displaystyle{ Q\, }[/math] [math]\displaystyle{ U_n(P,Q)\, }[/math] [math]\displaystyle{ V_n(P,Q)\, }[/math]
−1 3 OEISA214733
1 −1 OEISA000045 OEISA000032
1 1 OEISA128834 OEISA087204
1 2 OEISA107920 OEISA002249
2 −1 OEISA000129 OEISA002203
2 1 OEISA001477 OEISA007395
2 2 OEISA009545
2 3 OEISA088137
2 4 OEISA088138
2 5 OEISA045873
3 −5 OEISA015523 OEISA072263
3 −4 OEISA015521 OEISA201455
3 −3 OEISA030195 OEISA172012
3 −2 OEISA007482 OEISA206776
3 −1 OEISA006190 OEISA006497
3 1 OEISA001906 OEISA005248
3 2 OEISA000225 OEISA000051
3 5 OEISA190959
4 −3 OEISA015530 OEISA080042
4 −2 OEISA090017
4 −1 OEISA001076 OEISA014448
4 1 OEISA001353 OEISA003500
4 2 OEISA007070 OEISA056236
4 3 OEISA003462 OEISA034472
4 4 OEISA001787
5 −3 OEISA015536
5 −2 OEISA015535
5 −1 OEISA052918 OEISA087130
5 1 OEISA004254 OEISA003501
5 4 OEISA002450 OEISA052539
6 1 OEISA001109 OEISA003499

Applications

  • Lucas sequences are used in probabilistic Lucas pseudoprime tests, which are part of the commonly used Baillie–PSW primality test.
  • Lucas sequences are used in some primality proof methods, including the Lucas–Lehmer–Riesel test, and the N+1 and hybrid N−1/N+1 methods such as those in Brillhart-Lehmer-Selfridge 1975.[4]
  • LUC is a public-key cryptosystem based on Lucas sequences[5] that implements the analogs of ElGamal (LUCELG), Diffie–Hellman (LUCDIF), and RSA (LUCRSA). The encryption of the message in LUC is computed as a term of certain Lucas sequence, instead of using modular exponentiation as in RSA or Diffie–Hellman. However, a paper by Bleichenbacher et al.[6] shows that many of the supposed security advantages of LUC over cryptosystems based on modular exponentiation are either not present, or not as substantial as claimed.

Software

Sagemath implements [math]\displaystyle{ U_n }[/math] and [math]\displaystyle{ V_n }[/math] as lucas_number1() and lucas_number2(), respectively.[7]

See also

Notes

  1. For such relations and divisibility properties, see (Carmichael 1913), (Lehmer 1930) or (Ribenboim 1996).
  2. 2.0 2.1 Yabuta, M (2001). "A simple proof of Carmichael's theorem on primitive divisors". Fibonacci Quarterly 39: 439–443. http://www.fq.math.ca/Scanned/39-5/yabuta.pdf. Retrieved 4 October 2018. 
  3. Bilu, Yuri; Hanrot, Guillaume; Voutier, Paul M.; Mignotte, Maurice (2001). "Existence of primitive divisors of Lucas and Lehmer numbers". J. Reine Angew. Math. 2001 (539): 75–122. doi:10.1515/crll.2001.080. https://hal.inria.fr/inria-00072867/file/RR-3792.pdf. 
  4. John Brillhart; Derrick Henry Lehmer; John Selfridge (April 1975). "New Primality Criteria and Factorizations of 2m ± 1". Mathematics of Computation 29 (130): 620–647. doi:10.1090/S0025-5718-1975-0384673-1. 
  5. P. J. Smith; M. J. J. Lennon (1993). "LUC: A new public key system". Proceedings of the Ninth IFIP Int. Symp. On Computer Security: 103–117. 
  6. D. Bleichenbacher; W. Bosma; A. K. Lenstra (1995). "Some Remarks on Lucas-Based Cryptosystems". Advances in Cryptology — CRYPT0' 95. Lecture Notes in Computer Science. 963. pp. 386–396. doi:10.1007/3-540-44750-4_31. ISBN 978-3-540-60221-7. http://www.math.ru.nl/~bosma/pubs/CRYPTO95.pdf. 
  7. "Combinatorial Functions - Combinatorics". https://doc.sagemath.org/html/en/reference/combinat/sage/combinat/combinat.html. 

References