Kitamasa algorithm 2026-10-20
The Kitamasa algorithm evaluates a term of an order- linear recurrence by reducing powers of modulo its characteristic polynomial of a linear recurrence. If the recurrence relation is , reduce modulo by exponentiation by squaring; the resulting coefficients give as a linear combination of . Straightforward polynomial multiplication gives arithmetic operations.
Linear recurrence relation Created 2026-09-24 Updated 2026-11-05
A linear recurrence relation expresses each term of a sequence as a linear combination of earlier terms, possibly with an added forcing term. A constant-coefficient homogeneous recurrence of order has the form
Together with consecutive initial conditions, it determines the following terms uniquely. For example, the Fibonacci sequence satisfies , , .
Substituting gives the characteristic polynomial of a linear recurrence. Distinct characteristic roots give independent geometric solutions; repeated roots introduce factors polynomial in . This converts repeated term-by-term computation into polynomial or matrix arithmetic, useful for obtaining a distant term efficiently.
Lucas U-sequence Created 2026-10-20 Updated 2026-11-05
The Lucas U-sequence has , and . Its first terms are . At it is the Fibonacci sequence.
If the roots of its characteristic polynomial of a linear recurrence are distinct, . This identity follows by checking the two initial conditions and the linear recurrence relation. At a repeated root , the corresponding formula is for .
There is no forbidden pair in a sequence of length zero or one, so . For , divide acceptable sequences into two disjoint cases. If the first digit differs from , its probability is , and the remaining independent digits must avoid the pair. If the first digit is , the next must differ from , which has combined probability , and the remaining digits must avoid the pair. The boundary between this prefix and the remaining digits cannot create a forbidden pair, because the prefix ends in a digit other than . Consequently
The characteristic polynomial of a linear recurrence is , with distinct roots
Writing , the initial conditions give and . Therefore
For example, , since only one of the nine equally likely pairs is forbidden. This is the case with success probability of the avoidance recurrence for two consecutive successes.
Repeated characteristic root of a linear recurrence Created 2026-10-14 Updated 2026-11-05
For a constant-coefficient linear recurrence relation over the complex numbers, a nonzero root of multiplicity in its characteristic polynomial of a linear recurrence supplies the linearly independent solutions
Substitute . Each factor of the shift linear operator becomes times the forward difference operator on , so its th power kills every polynomial in of degree less than . Their independence follows from the Lagrange root bound over a field. The same argument works over a field of characteristic zero; the displayed monomials need modification in positive characteristic.
A zero root needs separate initial-data treatment: for characteristic polynomial , the recurrence relation is , leaving the first values arbitrary.