Three zeros decide parity
Write in binary: . There are exactly three zeros between its two ones. Write in binary: . There are only two. That single missing zero decides the parity of a huge factorial quotient.
The factorial is the product from to , with . The paper studies
Haobo Ma and Wenlin Zhang prove: this quotient is always a positive integer, and it is odd exactly when consecutive ones in the binary expansion of have at least three zeros between them. A single one satisfies the condition. So does , whose binary support is empty; indeed . See Theorem 2.1 for the precise statement; positivity follows directly from positivity of the factorials.
For example, is odd. The rule says that is even and is odd without expanding or . This is the benefit: a question about enormous products becomes a question about the digits of the input.
Peter Bala posed this parity conjecture in the References field of OEIS A295462 on 23 August 2026, and proved the two divisibilities discussed below. Gheorghe Coserea entered the sequence in 2017. This explanation follows version 4 of the paper. Integrality of these factorial ratios was already part of Jonathan W. Bober’s earlier classification.
Count the factors of two
A positive integer is even if it contains at least one factor of . For example, contains two. Write for the number of factors of a prime in a positive integer . For a positive rational number, subtract the denominator’s count from the numerator’s.
In , each even number contributes one factor of , each multiple of contributes another, and each multiple of another. Thus
Here is the greatest integer at most . Apply the same count to any prime , and subtract the denominator counts in the factorial quotient:
where the longer expression is easier to read on two lines:
The sum is finite: every term vanishes once . Because , adding to leaves unchanged. We only need , and all jumps lie on a grid of spacing . Checking its thirty cells shows that takes only the values and .
No prime can remain in the reduced denominator, so is an integer. More decisively, the summands cannot cancel: is odd exactly when every is zero.
Why three zeros?
Binary position has weight . If the ones are at least four positions apart, the tail below an occupied position can occupy, at most, positions . Hence
The inequality is strict because an integer has finitely many digits. The denominator comes from the geometric sum : it links the four-position spacing to the factorial coefficients.
Dividing by and taking the fractional part reads just the last binary digits. If their highest occupied position is , this fraction is , where and . Checking , and then , gives in every case. Sufficient spacing leaves no factor of two.
Conversely, move from low positions to high positions and find the first pair less than four positions apart. Its distance is . The lower digits have not yet violated the rule, so the same tail bound applies. Reading the last digits gives
All three cases give . That single summand is enough: all others are nonnegative, so the quotient is even. The precise proof includes the small tables that make both checks explicit.
The film connects these steps: read a suffix, inspect its gap, and detect the surviving factor of two.
Three zeros decide parity: from and to nonnegative prime-factor counts.
Beyond odd and even
Bala proved that both and divide . Both are odd, and any common divisor divides
They are therefore coprime, so their product also divides . Dividing by this odd product preserves parity. This is Corollary 2.2; at , for example, .
The spacing rule also counts. Let count inputs with odd . Write them as -digit binary words, allowing leading zeros. For , a valid word begins either with or with , giving
Thus and . The valid inputs below are . Corollary 2.3 also gives a recursion that lists all valid inputs in increasing order.
Another application concerns bitwise operations. XOR returns one when the two bits differ; AND returns one when both are one; OR returns one when at least one is one. If the ones in are at least four positions apart and , multiplying by places copies of its four-bit pattern in disjoint windows. Consequently, for ,
The analogous statements hold for AND and OR. For , , , each window works independently: . The paper also handles two identities outside the four-bit mask range using carries that stop after one position; Corollary 2.4 preserves them. Paul D. Hanna listed the eleven XOR identities in 2006; Sebastian Karlsson verified them with Walnut in 2022. This paper gives alternative written proofs using binary support.
A second factorial quotient
OEIS A295431 concerns a different number:
It must be distinguished from . It has its own periodic floor function taking values zero and one. The paper uses it to answer five divisibility questions posed by Bala on 28 August 2025, and to handle two product families of arbitrary length. For example,
There are exactly three factors in that denominator. More generally, after fixing a length , one can choose a constant independent of that makes division by integral for . The other family uses factors with coprime to . These factors may be negative but never zero. Corollary 2.5 gives the constants and all boundary cases.
Why can one constant handle a whole product? For each prime, select the denominator factor containing it to the highest power. Every other factor differs from this one by a difference of indices. The product of those differences is controlled by . The strongest factor is controlled by the floor function for and a least common multiple. An arbitrary product reduces to one factor plus its index differences. The constants are sufficient; the paper does not assert that they are smallest.
Evidence and limits
The precise statements and proofs retain all six source results, including both sets of binomial formulas, the hypergeometric generating functions, Mathar’s recurrence, and the asymptotic expansions. Numerical examples in the story illustrate the argument; they do not replace proofs for all inputs.
The Lean parity declaration proves that a natural number realizes the rational quotient and characterizes its parity. Positivity follows from the positive factorials. The Lean divisibility declaration covers all five fixed A295431 divisibilities and both unbounded product families. The quotient , counting, bitwise operations and additional formulas retain written proofs and their shared formalization requests here.
These results do not supply A295431’s explicit moment density, its shape or uniqueness, or analogous divisibility results for each of the other 51 sporadic ratios. Prime-power congruences and integrality at half and third arguments have prior proofs cited by the manuscript; they are distinct from the two product families here. See Sources for attribution and contribution links.
The seminar follows the same path from examples to the mechanism and its extensions.
Statements and proofs
Throughout, is a nonnegative integer and . The six results below correspond to source Theorem 1 and Corollaries 2–6. Put for the set of occupied binary positions of . It is four-separated when for all in , including the empty set. Define
For every , there is a natural number with in the rationals, and is odd if and only if is four-separated.
The source also states : every factorial is positive and the denominator is nonzero, so this natural realization is strictly positive. This elementary consequence is separated here from the literal conclusion of the formal declaration above.
Put
Balance of the coefficients gives . On the half-open cell , , its value is . In groups of ten, these values are
Thus , including the jump points. Legendre’s formula gives , with zero terms for . A positive rational with all prime valuations nonnegative is an integer; at it equals . For , the sum vanishes exactly when every summand vanishes.
For four-separated support, a tail below position and at least four positions away satisfies
Fix and put . If , then . Otherwise write , , and . Then with . The five-tuples below list :
- : ;
- : ;
- : ;
- : .
Every row gives ; periodicity identifies it with .
If the support is not four-separated, choose the lowest occupied position with a predecessor among the previous three positions, and let be its immediately preceding occupied position. Then . Minimality of makes the lower part four-separated, so
At , , the three five-tuples are , and . Each gives , so . This proves both directions. Source: §2, proof of Theorem 1; the linked declaration supplies the complete formal proof.
is a positive integer for every , and is odd if and only if is four-separated.
This is source Corollary 2 in §3; the divisibilities are attributed to Bala (2026). Let or . If a prime divides , then . For each , put and . Write , where and . Thus . For , and ; for , and . Substitution into , in the preceding five-tuple order, gives:
- : ; : ;
- : ; : ;
- : ; : .
Every row gives , including the smallest allowed endpoint . Hence , proving . The two divisors are odd and any common divisor divides . They are coprime, so their product divides . The quotient is positive and its divisor odd, giving . Apply Theorem 2.1. At the quotient is .
Let count inputs with odd . Then
List these inputs in increasing order as . Then . For there is a unique with , and
Source §3, Corollary 3. By Theorem 2.1, count four-separated binary words. Allowing leading zeros, the counts at lengths are . At length , an initial leaves any valid word of length ; an initial must be followed by , leaving any valid word of length . These disjoint cases exhaust the possibilities.
The counts strictly increase because is a new valid input, and are unbounded because every single-one word is valid. Thus exists uniquely. Exactly valid inputs lie below . For , those in are precisely plus valid suffixes below ; for , only the zero suffix is possible. Their internal order is the suffix order, so subtracting from the enumeration index proves the recursion.
If is odd, then for ,
The same identity holds with XOR replaced throughout by AND or OR. Each triple below also satisfies :
Source §4, Corollary 4. The eleven identities are attributed to Hanna (2006), with earlier Walnut verification by Karlsson (2022). By Theorem 2.1, is four-separated. The four-bit blocks in are disjoint, so all three bitwise operations act block by block. This proves the general formulas and the first nine triples.
For the final two triples take or and put . The sets and are disjoint: an intersection would put two positions of at distance or . A collision in the addition occurs only at and creates a carry at . This position is not in , since it would be adjacent to , or in , since then would be adjacent to in . Every carry therefore stops after one position. A carry position also avoids and , since otherwise a position of would be at distance or from . Hence have pairwise disjoint supports, and
The pairs are and . Associativity of XOR and give the listed triples after XORing again with . This includes . The source also observes that, for every , -separated support and masks obey the corresponding blockwise XOR/AND/OR formulas: their blocks have length and are disjoint.
Products of arbitrary length
Let for , and define
The following five expressions are integers for every . With the constants displayed below, the final two expressions are also integers for every and (and in the first family).
All denominators are nonzero. Signed factors are interpreted in the integers, and .
Source §5, Corollary 5. The linked formal proof covers every displayed expression and quantifier. Here is the mechanism behind the uniform constants. Put
It has period one and values on the twelve half-open cells of length . Thus is a positive integer and ; terms vanish when .
For the fixed expressions, inspect the left-hand cells forced by . For , misses one unit only at ; misses one only at ; has no missing levels. These explain and . At the small primes Legendre’s formula gives
where is the base- digit sum. If , , the last bits of are , of weight , and the positive prefix supplies another one; is immediate. If , the last bits are all one. If , the last ternary digits of sum to , and the positive prefix supplies at least one more. If , those digits are all two. This completes the first three expressions. The three denominators are pairwise coprime except for a possible extra factor of two shared by and ; when both are even, one has binary valuation one. The two missing levels modulo five occur in distinct residue classes, so suffices. If , then and the point approaches from the right, , always giving . This proves integrality of the expression with denominator .
For a general denominator product, select a factor with maximal -valuation , at index . Every other factor has valuation at most , by subtracting the maximal factor; equal valuations also satisfy this bound. The product of the relevant differences divides , which divides . This works for subsets and signed factors as well. Writing for the denominator product, we obtain
For the first family put . If , and , the fractional residue is , in a left-hand interval of width at or . Thus and . For , use
on and , with . If , then ; otherwise . In the remaining case , the valuation is zero if ; if , extracting loses at most one further unit. Both small primes therefore satisfy . The factor supplies , supplies the small-prime allowance, and handles the other factors.
For the second family, every factor is coprime to six. If divides , the fractional residue is , , in a right-hand cell with . Hence , supplied by and the same product bound. Finally, contradicts , so no denominator vanishes.
The binomial identities, hypergeometric series and asymptotic formulas in A295462 and A295431 hold, as does Mathar’s recurrence for A295431. The proof below explicitly lists the formulas and definitions meant by source §6, Corollary 6.
Source §6, Corollary 6. Expanding factorials gives Chai Wah Wu’s two A295462 identities:
Divide every element of the first displayed set by , and define the parameters:
This ratio follows by cancellation of consecutive factorials, with . Define the rising factorial by and . The th term of is . The initial value and this ratio uniquely determine the coefficients, so as a formal power series,
Stirling’s formula gives the asymptotic expression recorded by Amiram Eldar in A295462:
The factors cancel, the powers of leave , and the square-root constant is .
For the same cancellation gives Wu’s two A295431 identities:
The consecutive ratio is Mathar’s recurrence ():
Using and the same coefficient-ratio argument gives the formal generating function, with its parameters on separate lines:
Finally, Penson’s expansion is (as )
Stirling’s logarithmic expansion gives the square-root prefactor and the coefficient . There is no term in the logarithm; exponentiating supplies , with the Stirling remainder giving . The formal series identities require no choice of a convergence point. The asymptotics apply along positive integers as , and are not evaluated at .
Sources and contributions
This explanation, presentation and film follow version 4 of the paper by Haobo Ma and Wenlin Zhang. Haobo Ma is affiliated with Chrono AI, Singapore; Wenlin Zhang with Chrono AI and the National University of Singapore, Singapore. Names retain their source spelling.
The paper and earlier work
Bober’s classification already established integrality of the two factorial ratios here. Bala (2026) proved divisibility by and . This paper proves the binary-spacing parity characterization, derives quotient and enumeration consequences, gives alternative written proofs of Hanna’s eleven identities, and handles the fixed divisibilities and both A295431 product families. Karlsson’s Walnut verification precedes these alternative proofs.
The A295431 prime-power congruences have prior proofs. Bajaj–Burns (August 2026), followed by Blanco Gómez (October 2026), give
for primes and , through the classical Jacobsthal–Kazandzidis binomial congruence cited by the source. Zudilin covers the one-level case . Integrality of and in the Gamma-factorial interpretation is Blanco Gómez’s Corollary 1.5; the questions already occur in Bala (2016), p. 5. These results are distinct from the product divisibilities in Corollary 2.5.
References
- Haobo Ma and Wenlin Zhang, Parity and product extensions of Bala’s divisibilities (2026): OEIS A295462, References (record #19; contribution dated 23 August 2026), version 4. DOI:10.5281/zenodo.23971279. CC BY 4.0. Original PDF.
- OEIS Foundation, A295462, internal record #19. Entry by Gheorghe Coserea (28 November 2017); References contribution by Peter Bala (23 August 2026).
- Peter Bala, A295462(n) is divisible by 6n+1 and 10n+1, 23 August 2026, three-page note.
- Jonathan W. Bober, Factorial ratios, hypergeometric series, and a family of step functions, J. London Math. Soc. (2) 79 (2009), 422–444. DOI:10.1112/jlms/jdn078. arXiv:0709.1977v1, Theorem 3.1, Lemma 3.2, Table 2 row 32.
- K. Soundararajan, Integral factorial ratios, arXiv:1901.05133v1, 16 January 2019, Theorem 1.1 and proof.
- OEIS Foundation, A048718, internal record #25. Entry by Antti Karttunen (30 March 1999); Comments and Formula fields include Hanna’s eleven identities (22 January 2006).
- Sebastian Karlsson, Walnut code that verifies the conjectures of Paul D. Hanna, 31 December 2022, public formulas.
- OEIS Foundation, A295431, internal record #101. Entry by Gheorghe Coserea (22 November 2017); Bala’s divisibility questions in Comments (28 August 2025). Formula attributions to Chai Wah Wu, Mathar and Penson are retained as recorded in the source paper.
- Wadim Zudilin, Congruences for q-binomial coefficients, arXiv:1901.07843v2, 1 April 2019, §5, Theorem 3.
- Ravi Bajaj and Alexander Burns, Balanced factorial ratios inherit a cubic tower, August 2026, §1, pinned scientific text.
- Peter Bala, Some integer ratios of factorials, August 2016, six-page note, p. 5.
- Roberto Blanco Gómez, Supercongruences modulo and integrality for factorial ratios with fractional arguments, with proofs of conjectures of P. Bala, 17 October 2026. DOI:10.5281/zenodo.23426707, Corollaries 1.4(d), 1.5, proofs in §5.2.
Contribute a formalization
Four written results still need their matching formalization; each already has a manuscript proof:
- Removing two odd factors: reuse the parity theorem and establish quotient integrality and parity.
- Counting and ordered enumeration: reuse spacing and handle short words and recurrence boundaries.
- Bitwise operations and eleven identities: four-bit block formulas plus the two extra one-step-carry arguments.
- Coefficient formulas and asymptotics: exact coefficient ratios, formal series and Stirling expansions.
Coordinate scope on the corresponding request, work on a focused branch in your own fork, and submit directly to upstream dev under its contribution rules. A shared request records work; it does not certify a proof. Original authors, earlier work and formalization contributions receive separate attribution. The existing parity theorem and A295431 divisibilities need no duplicate construction.
Verification ledger
Lean-verified results correspond to frozen declarations in trureturing. Written proofs and open items are listed separately below. The table lists the Lean correspondence; links are fixed to the pinned commit, so they do not drift with upstream changes.
Formal basis: trureturing commit 8a24ea4e79de · the-omega-institute/trureturing
| Item | Title | Lean declaration | Frozen state |
|---|---|---|---|
| Theorem 2.1 | Natural realization and parity | D5.S3.Arith.FactorialRatio.BalaA295462Parity.result | 33ec410ab1 |
| Corollary 2.5 | Fixed divisibilities and two product families | D5.S3.Arith.FactorialRatio.BalaA295431Divisibility.result | 572e96d7d4 |
Written proofs
These results cite DOI sources, book proofs and registered formalization requests. They are not kernel-verified and are excluded from LEAN ✓ counts.
- Corollary 2.2 — Removing two odd factors · Proof · DOI: 10.5281/zenodo.23971279 · Corollary 2 · trureturing-requests#264
- Corollary 2.3 — Counting and ordered enumeration · Proof · DOI: 10.5281/zenodo.23971279 · Corollary 3 · trureturing-requests#265
- Corollary 2.4 — Four-bit windows and eleven XOR identities · Proof · DOI: 10.5281/zenodo.23971279 · Corollary 4 · trureturing-requests#266
- Corollary 2.6 — Coefficient formulas and growth · Proof · DOI: 10.5281/zenodo.23971279 · Corollary 6 · trureturing-requests#267
Open problems and conjectures
The following items are explicitly marked open; the book does not treat them as proved.
(none)