Density and Symmetry in the Generalized Motzkin Numbers Modulo \(p\)
Published in Integers, 2026
We prove a new functional equation for the generalized Motzkin numbers modulo a prime: \(M_{p-3-n}^{a,b} \equiv (b^2 - 4a^2)^{\frac{p-3}{2}-n}M_n^{a,b}\pmod p\). We also give a formula for the density of 0 in the sequence of generalized Motzkin numbers modulo a prime, \(p\), in terms of the first \(p\) generalized central trinomial coefficients \(T_n^{a,b}\bmod p\) (with \(n<p\)). We apply our method to various other sequences to obtain similar formulas. THese formulas provide easy-to-compute tight lower bounds for the density of 0 in our sequences modulo primes. THey also reveal an unexpected connection between the Riordan numbers and the number of directed animals of size \(n\). Along the way, we provide a general characterization of the \(n\) such that \(p\mid M_n^{a,b}\), which generalizes previous results of Deutsch and Sagan.
