[Paper Review] Efficient Computation of Terms of Linear Recurrence Sequences of Any Order
This paper presents an efficient algorithm for computing terms of linear recurrence sequences of any order using modular polynomial squaring techniques, significantly reducing computational complexity. By deriving closed-form formulas for doubling indices and leveraging matrix representations, the method achieves O(n² log N) multiplications, outperforming prior approaches like Fiduccia's in practical efficiency for high-order recurrences.
In this paper we give efficient algorithms for computing second-, third-, and fourth-order linear recurrences. We also present an algorithm scheme for computing terms with the indices $N,\ldots,N+n-1$ of an $n$th-order linear recurrence. Unlike Fiduccia's algorithm our approach uses certain formulas for modular polynomial squarings.
Motivation & Objective
- To develop a fast algorithm for computing the Nth term of an n-th order linear recurrence sequence.
- To improve upon Fiduccia's algorithm by optimizing modular polynomial squaring operations.
- To provide a unified framework applicable to second-, third-, and fourth-order recurrences, and generalize to arbitrary orders.
- To minimize the number of multiplications required, especially for large N, by exploiting recurrence structure and matrix identities.
Proposed method
- The method uses matrix representations of recurrence transitions, particularly focusing on doubling formulas for indices 2k and 2k+1.
- It derives explicit recurrence relations for X_{2k+i} and X_{2k+1+i} in terms of X_{k+j}, using coefficients from the characteristic polynomial.
- The algorithm employs a recursive doubling strategy based on derived formulas that avoid full matrix exponentiation.
- It computes terms X_{N+i} for i=0 to n-1 using iterative squaring of intermediate state vectors, reducing the number of multiplications.
- The approach uses modular polynomial squaring techniques, hard-coded for efficiency, to compute the required terms without full matrix inversion.
- A Mathematica implementation is provided as a proof-of-concept, with the function AnyOrderRecurrence accepting initial values and recurrence coefficients.
Experimental results
Research questions
- RQ1How can the computation of high-order linear recurrence terms be optimized to reduce multiplicative complexity?
- RQ2Can closed-form doubling formulas be systematically derived for arbitrary-order linear recurrences?
- RQ3What is the minimal number of multiplications required to compute the Nth term of an n-th order linear recurrence?
- RQ4How does the proposed method compare in efficiency to Fiduccia’s algorithm for large N and high n?
Key findings
- The algorithm computes the Nth term of an n-th order linear recurrence using O(n² log N) multiplications, which is more efficient than Fiduccia’s O(μ(n) log N) when μ(n) is large.
- For even n, the method requires exactly n(n+1)/2 log₂N multiplications per step, with the same bound holding for odd n via analogous derivation.
- The method generalizes to any order n, with explicit formulas provided for X_{2k} and X_{2k+1} in terms of X_{k+i} using polynomial identities.
- The approach enables simultaneous computation of multiple terms W_N, W_{N+1}, ..., W_{N+n-1} with minimal overhead.
- The implementation in Mathematica confirms the correctness and efficiency of the algorithm, particularly for large N and moderate n.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.