Dyck factors of the paperfolding sequence: a conjecture of Mol, Rampersad and Shallit
Mol, Rampersad and Shallit conjectured that the paperfolding sequence has a Dyck factor of length $n$ if and only if $n=2^k-2^i$ with $0\le i<k$, taking $0$ as the left parenthesis. The value $i=0$ gives odd lengths, which a Dyck word cannot have, and the set of lengths depends on which of the two complementary $0/1$ versions of the paperfolding sequence is meant. We prove that for the regular paperfolding sequence in the convention of OEIS A014707 the nonempty Dyck factors have exactly the lengths $2^k-2^i$ with $1\le i<k$. For the complementary convention (OEIS A014577) the factor of length $10$ beginning at position $11$ is a Dyck word, so there the conjectured set is not correct. The proof rests on the classical fact that the partial sums of the $\pm1$ paperfolding sequence count the runs in binary expansions. The theorem and the two counterexamples are formalized in Lean 4 and checked by the Lean kernel. For A014577 we also report the set of lengths up to $2048$, found by computation. Lean 4 formalization: https://github.com/wray-lee/oeis-conjectures-lean (Proofs/CM_33_2_P5.lean).
Authors
- Yufeng Liu (ORCID: https://orcid.org/0000-0002-1686-0545)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-02
- DOI
- https://doi.org/10.5281/zenodo.24729043
- Primary Topic
- semigroups and automata theory
- Type
- preprint