On modular representations of C-recursive integer sequences
Mihai Prunescu, Joseph M. Shunia
TL;DR
This work studies modular representations of $C$-recursive integer sequences by connecting div-mod and mod-mod forms. Starting from the well-known div-mod representation $t(n)=\left\lfloor \dfrac{c^{n^2}\tilde{A}(c^n)}{\tilde{B}(c^n)}\right\rfloor \bmod c^n$ derived from rational generating functions, the authors derive a corrected mod-mod representation that holds for all $n\ge1$ via an external arithmetic short-cut. Central to the approach is a principal modular-arithmetic Lemma that enables transforming nested mod operations and a constructive choice of base $e$ to realize a universal formula: $t(n) = \frac{-1-\operatorname{sgn}(\alpha_d)}{2} + \frac{1}{|\alpha_d|}\left(\big( -\operatorname{sgn}(\alpha_d)\,e^{n^2}\tilde{A}(e^n) \bmod \tilde{B}(e^n) \big) \bmod e^n\right)$ for all $n\ge1$, where $\alpha_d$ is the free term of $\tilde{B}$. The paper also demonstrates the method on numerous explicit examples (Fibonacci, Lucas, Pell, Tribonacci, Padovan, Narayana's cows, etc.), illustrating when inner corrections are unnecessary and how larger bases may be required, with implications for efficient arithmetic extraction from generating functions.
Abstract
Prunescu and Sauras-Altuzarra showed that all C-recursive sequences of natural numbers have an arithmetic div-mod representation that can be derived from their generating function. This representation consists of computing the quotient of two exponential polynomials and taking the remainder of the result modulo a third exponential polynomial, and works for all integers $n \geq 1$. Using a different approach, Prunescu proved the existence of two other representations, one of which is the mod-mod representation, consisting of two successive remainder computations. This result has two weaknesses: (i) the representation works only ultimately, and (ii) a correction term must be added to the first exponential polynomial. We show that a mod-mod representation without inner correction term holds for all integers $n \geq 1$. This follows directly from the div-mod representation by an arithmetic short-cut from outside.
