Computational verification code for the paper:
Binary Convolution Theory: A Structural Approach to Perfect Numbers
Masamichi Iizumi, Tamaki Iizumi
Run all verifications instantly in your browser:
Binary Convolution Theory (BCT) provides a novel framework for studying the multiplicative structure of integers through their binary representations. This repository contains the verification code for all theorems presented in the paper.
- Binary Convolution Height H(a,b): Maximum value in the pre-carry convolution of bin(a) and bin(b)
- BCT-Perfect Numbers: Integers where H(a,b) = 1 for all non-trivial factorizations
- The Main Insight: BCT-perfectness (structural balance) appears incompatible with classical perfectness (σ(n) = 2n) for odd numbers
pip install binary-convolution-theorygit clone https://github.com/miosync-masa/BinaryConvolutionTheory.git
cd BinaryConvolutionTheory
pip install -e .BinaryConvolutionTheory/
├── README.md
├── setup.py
├──src/
│ │
│ bct/
│ ├── core/
│ │ ├── __init__.py
│ │ ├── binary_utils.py # Binary representation utilities
│ │ └── bct_invariants.py # BCT invariants (H, C, L, etc.)
│ └── theorems/
│ ├── __init__.py
│ ├── thm1_2_upper_bound.py # Theorems 1-2: Upper Bounds
│ ├── thm3_equality_condition.py # Theorem 3: Equality Condition
│ ├── thm4_5_mersenne.py # Theorems 4-5: Mersenne Properties
│ ├── thm6_fermat_resonance.py # Theorem 6: Fermat Minimum Resonance
│ ├── thm7_prop5_sweep.py # Theorem 7 & Prop 5: Carry Schedules
│ ├── thm8_even_perfect.py # Theorem 8: Even Perfect Numbers
│ ├── lemma4_thm9_fermat.py # Lemma 4 & Theorem 9: Fermat Primes
│ ├── thm10_structure.py # Theorem 10: BCT-Perfect Structure
│ ├── thm11_conjecture1_abundance.py # Theorem 11(b) & Conjecture 1
│ └── remaining_lemmas_theorems.py # Lemmas 1-3, Thm 11(a), 12, 13
from bct.core.binary_utils import bin_seq, bin_str, popcount, is_fermat
from bct.core.bct_invariants import H, C, L, is_bct_perfect, sigma, abundance_ratio
# Binary Convolution Height
print(H(3, 5)) # 1 (orthogonal)
print(H(7, 7)) # 3 (Mersenne self-convolution)
# Check BCT-perfectness
print(is_bct_perfect(15)) # True (3 × 5)
print(is_bct_perfect(21)) # False (3 × 7)
# Even perfect numbers
print(is_bct_perfect(28)) # True
print(abundance_ratio(28)) # 2.0 (perfect!)For S ⊂ {0, ..., L-1} with |S| = w:
max_k r_S(k) ≥ ⌈w² / (2L-1)⌉
Verified: 99,998 integers (n < 10⁵), 0 violations
H(2^a, m) = 1 for any a ≥ 1 and m ≥ 1
Verified: 20,000 cases (a ≤ 20, m ≤ 1000), all H = 1
n = 2^a · m is BCT-perfect ⟺ m is BCT-perfect
Verified: 8,769 composite numbers (n < 10⁴), 0 violations
An odd prime p has popcount(p) = 2 ⟺ p is a Fermat prime
Verified: All odd primes p < 10⁶ with popcount = 2
Found: Exactly 5 such primes: F₀=3, F₁=5, F₂=17, F₃=257, F₄=65537
For any factorization n = a × b:
H(a, b) ≤ min(popcount(a), popcount(b))
Verified: 483,533 factorizations (n ≤ 10⁵), 0 violations
H(n²) := H(n, n) ≤ popcount(n)
Verified: 99,999 integers (n ≤ 10⁵), 0 violations
H(n²) = popcount(n) ⟺ the 1-bits of bin(n) are centrally symmetric
Verified: 999,999 integers (n < 10⁶), 100% biconditional
Notable: Maximum gap = 6 at n = 807,743 (unique!)
For Mersenne numbers M_k = 2^k - 1:
H(M_k²) = k = popcount(M_k) (Theorem 4)
C(M_k²) = (k-1)² (Theorem 5)
Verified: k ∈ [2, 20], exact match
For Fermat numbers F_k = 2^(2^k) + 1:
H(F_k²) = 2 (constant, independent of k)
Verified: k ∈ [0, 7], all H = 2
Key Contrast:
| Type | k=2 | k=3 | k=4 | Pattern |
|---|---|---|---|---|
| Mersenne | 2 | 3 | 4 | H = k (grows!) |
| Fermat | 2 | 2 | 2 | H = 2 (constant!) |
L(a, b) = 1 for all factorizations (sequential LSB→MSB model)
Verified: 16,723 factorizations (n ≤ 5,000), all L = 1
For m = (2^k + 1)/3 with odd k ≥ 3:
H(3, m) = 2, but L_par(3, m) = k - 1
Verified: odd k ∈ [3, 21], all match
Key Insight: L_par can grow arbitrarily while H stays at 2!
For even perfect P = 2^(p-1) × (2^p - 1) where 2^p - 1 is Mersenne prime:
H(P) = 1
bin(P) = 1^p 0^(p-1)
Verified: First 7 even perfect numbers, all H = 1
| p | P | Binary Pattern | H | σ/P |
|---|---|---|---|---|
| 2 | 6 | 110 | 1 | 2.00 |
| 3 | 28 | 11100 | 1 | 2.00 |
| 5 | 496 | 111110000 | 1 | 2.00 |
| 7 | 8128 | 1111111000000 | 1 | 2.00 |
All Fermat primes F_i, F_j are pairwise binary orthogonal: H(F_i, F_j) = 1 for i ≠ j
Verified: All 10 pairs of F₀, F₁, F₂, F₃, F₄, all H = 1
Structural Reason: F_k has 1-bits at positions {0, 2^k}, so sumsets are always disjoint.
BCT-perfect odd composites are constrained to specific structural types:
| Type | Count | Percentage | Max σ/n | Example |
|---|---|---|---|---|
| p × q | 487 | 93.30% | 1.6000 | 15 = 3 × 5 |
| p × q × r | 18 | 3.45% | 1.6941 | 255 = 3 × 5 × 17 |
| p² × q | 7 | 1.34% | 1.6508 | 63 = 3² × 7 |
| p³ | 3 | 0.57% | 1.4815 | 27 = 3³ |
| Other | 7 | 1.34% | 1.7007 | 65535 = 3×5×17×257 |
Verified: 522 BCT-perfect odd composites (n < 10⁵)
(a) General bound: For odd squarefree semiprimes n = pq:
σ(n)/n ≤ 8/5 = 1.6
Verified: 4,371 semiprimes, maximum at (p,q) = (3,5)
(b) Computational observation: For all BCT-perfect odd composites n < 10⁵:
σ(n)/n < 1.71
Verified: 522 BCT-perfect odds, max = 1.7007 at n = 65535
An odd perfect number cannot be a squarefree semiprime pq
Verified: Follows from Theorem 11(a) since 1.6 < 2
No odd BCT-perfect composite n < 10⁶ satisfies σ(n)/n = 2
Verified: 2,017 BCT-perfect odd composites (n < 10⁶), all σ/n < 1.71
For all BCT-perfect odd composite n: σ(n)/n < 2
Verified: n < 10⁶, max σ/n = 1.7007
Gap from perfection: 0.2993
🌟 IMPLICATION: If Conjecture 1 holds for all n, then:
{Odd perfect numbers} ⊆ {BCT-imperfect numbers}
| Item | Range Verified | Result |
|---|---|---|
| Lemma 1 | n < 10⁵ | ✅ No violations |
| Lemma 2 | a ≤ 20, m ≤ 1000 | ✅ All H = 1 |
| Lemma 3 | n < 10⁴ | ✅ Inheritance holds |
| Lemma 4 | p < 10⁶ | ✅ All sparse primes are Fermat |
| Theorem 1-2 | n ≤ 10⁵ | ✅ No counterexamples |
| Theorem 3 | n < 10⁶ | ✅ 100% biconditional |
| Theorem 4-5 | k ∈ [2, 20] | ✅ Exact match |
| Theorem 6 | k ∈ [0, 7] | ✅ All H = 2 |
| Theorem 7 | n ≤ 5,000 | ✅ All L = 1 |
| Proposition 5 | odd k ∈ [3, 21] | ✅ L_par = k - 1 |
| Theorem 8 | First 7 even perfects | ✅ All H = 1 |
| Theorem 9 | F₀ through F₄ | ✅ All pairs orthogonal |
| Theorem 10 | n < 10⁵ | ✅ Structure matches Table 1 |
| Theorem 11(a) | p, q < 500 | ✅ σ/n ≤ 1.6 |
| Theorem 11(b) | n < 10⁵ | ✅ σ/n < 1.71 |
| Theorem 12 | — | ✅ Logical consequence |
| Theorem 13 | n < 10⁶ | ✅ No BCT-perfect perfect |
| Conjecture 1 | n < 10⁶ | ✅ σ/n < 2 |
Each theorem module can be run standalone:
# Run all verifications
python -m bct.theorems.thm1_2_upper_bound
python -m bct.theorems.thm3_equality_condition
python -m bct.theorems.thm4_5_mersenne
python -m bct.theorems.thm6_fermat_resonance
python -m bct.theorems.thm7_prop5_sweep
python -m bct.theorems.thm8_even_perfect
python -m bct.theorems.lemma4_thm9_fermat
python -m bct.theorems.thm10_structure
python -m bct.theorems.thm11_conjecture1_abundance
python -m bct.theorems.remaining_lemmas_theoremsbin_seq(n) # LSB-first bit sequence [b₀, b₁, ...]
bin_str(n) # MSB-first string for display
popcount(n) # Number of 1-bits (Hamming weight)
bit_positions(n) # Set of positions with 1-bits
is_centrally_symmetric(n) # Check bit symmetry
is_mersenne(n) # Check if Mersenne number
is_fermat(n) # Check if Fermat numberH(a, b) # Binary Convolution Height
C(a, b) # Total Carry Count
L(a, b) # Chain Length (sequential)
L_parallel(a, b) # Chain Length (parallel)
is_bct_perfect(n) # Check BCT-perfectness
sigma(n) # Sum of divisors σ(n)
abundance_ratio(n) # σ(n)/n- Computation: LSB-first (index 0 = least significant bit)
- Display: MSB-first (standard binary notation)
This matches the paper's convention where:
bin(n) = (b₀, b₁, ..., bₖ) where n = Σ bᵢ · 2ⁱ
All verifications use ranges matching or exceeding those in the paper's Table 4.
@software{iizumi2026bct_code,
author = {Iizumi, Masamichi and Iizumi, Tamaki},
title = {Binary Convolution Theory: Verification Code},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.18211340},
url = {https://doi.org/10.5281/zenodo.18211340}
}MIT License - see LICENSE for details.
Masamichi Iizumi
Tamaki Iizumi
Miosync, Inc., Tokyo, Japan
m.iizumi@miosync.email