Given two integer parameters P and Q, the Lucas sequences of the first kind Un and of the second kind Vn are defined by the recurrence relations: and It is not hard to show that for,
Examples
Initial terms of Lucas sequences Un and Vn are given in the table:
Explicit expressions
The characteristic equation of the recurrence relation for Lucas sequences and is: It has the discriminant and the roots: Thus: Note that the sequence and the sequence also satisfy the recurrence relation. However these might not be integer sequences.
Distinct roots
When, a and b are distinct and one quickly verifies that It follows that the terms of Lucas sequences can be expressed in terms of a and b as follows
If the Lucas sequences and have discriminant, then the sequences based on and where have the same discriminant:.
Pell equations
When, the Lucas sequences and satisfy certain Pell equations:
Other relations
The terms of Lucas sequences satisfy relations that are generalizations of those between Fibonacci numbers and Lucas numbers. For example: Among the consequences is that is a multiple of, i.e., the sequence is a divisibility sequence. This implies, in particular, that can be prime only when n is prime. Another consequence is an analog of exponentiation by squaring that allows fast computation of for large values of n. Moreover, if, then is a strong divisibility sequence. Other divisibility properties are as follows:
If n / m is odd, then divides.
Let N be an integer relatively prime to 2Q. If the smallest positive integerr for which N divides exists, then the set of n for which N divides is exactly the set of multiples of r.
If P and Q are even, then are always even except.
If P is even and Q is odd, then the parity of is the same as n and is always even.
If P is odd and Q is even, then are always odd for.
If P and Q are odd, then are even if and only ifn is a multiple of 3.
If p is an odd prime and divides P and Q, then p divides for every.
If p is an odd prime and divides P but not Q, then p divides if and only if n is even.
If p is an odd prime and divides not P but Q, then p never divides for.
If p is an odd prime and divides not PQ but D, then p divides if and only if p divides n.
If p is an odd prime and does not divide PQD, then p divides, where.
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, where. Such a composite is called 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. Indeed, Carmichael showed that if D is positive and n is not 1, 2 or 6, then has a primitive prime factor. In the case D is negative, a deep result of Bilu, Hanrot, Voutier and Mignotte shows that if n > 30, then has a primitive prime factor and determines all cases has no primitive prime factor.
Specific names
The Lucas sequences for some values of P and Q have specific names: Some Lucas sequences have entries in the On-Line Encyclopedia of Integer Sequences:
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
LUC is a public-key cryptosystem based on Lucas sequences that implements the analogs of ElGamal, Diffie-Hellman, and RSA. 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. 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.