Doubling modulo odd integers, generalizations, and unexpected occurrences
Jean-Paul Allouche, Manon Stipulanti, Jia-Yan Yao
TL;DR
This work analyzes the doubling map modulo an odd integer and its generalization to the $(k,n)$-perfect shuffle $\sigma_{k,n}: x \mapsto kx \bmod{(kn+1)}$, introducing the cycle-count $C_k(n)$ and proving a direct equality between two known expressions for the cycle count when $k=2$. It provides two distinct proofs—arithmetic and algebraic—relating $C_k(n)$ to the auxiliary quantity $i_k(kn+1)$, and derives a suite of equivalent formulas, including $i_k(kn+1)=\frac{1}{\mathsf{ord}(k,kn+1)}\sum_{j=0}^{\mathsf{ord}(k,kn+1)-1}\gcd(k^j-1,kn+1)$ and the irreducible-factor count of $X^{kn+1}-1$ over $\mathbb{F}_k$. The paper also establishes asymptotic bounds $C_k(n)=O(n/\log n)$ and discusses the tightness of these bounds. Beyond the core theory, it surveys a wide range of unexpected occurrences of the doubling map and the map $i_k$ across mathematics and the arts, including Toeplitz transforms, apwenian sequences, dynamical systems, the Luhn algorithm, card-shuffling, juggling, bell-ringing, poetry, and musical composition, highlighting rich connections between number theory, combinatorics, and cultural practices.
Abstract
The starting point of this work is an equality between two quantities $A$ and $B$ found in the literature, which involve the {\em doubling-modulo-an-odd-integer} map, i.e., $x\in {\mathbb N} \mapsto 2x \bmod{(2n+1)}$ for some positive integer $n$. More precisely, this doubling map defines a permutation $σ_{2,n}$ and each of $A$ and $B$ counts the number $C_2(n)$ of cycles of $σ_{2,n}$, hence $A=B$. In the first part of this note, we give a direct proof of this last equality. To do so, we consider and study a generalized $(k,n)$-perfect shuffle permutation $σ_{k,n}$, where we multiply by an integer $k\ge 2$ instead of $2$, and its number $C_k(n)$ of cycles. The second part of this note lists some of the many occurrences and applications of the doubling map and its generalizations in the literature: in mathematics (combinatorics of words, dynamical systems, number theory, correcting algorithms), but also in card-shuffling, juggling, bell-ringing, poetry, and music composition.
