Binary Convolution Theory: A Structural Approach to Perfect Numbers
Project description
Binary Convolution Theory (BCT) - Verification Code
Computational verification code for the paper:
Binary Convolution Theory: A Structural Approach to Perfect Numbers
Masamichi Iizumi, Tamaki Iizumi
🚀 Quick Start (Google Colab)
Run all verifications instantly in your browser:
Overview
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.
Key Concepts
- 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
Installation
From PyPI (recommended)
pip install binary-convolution-theory
From source
git clone https://github.com/miosync-masa/BinaryConvolutionTheory.git
cd BinaryConvolutionTheory
pip install -e .
Repository Structure
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
Usage
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!)
Verified Theorems
Lemma 1 (Counting Lemma for Sumsets)
For S ⊂ {0, ..., L-1} with |S| = w:
max_k r_S(k) ≥ ⌈w² / (2L-1)⌉
Verified: 99,998 integers (n < 10⁵), 0 violations
Lemma 2 (Power of Two Orthogonality)
H(2^a, m) = 1 for any a ≥ 1 and m ≥ 1
Verified: 20,000 cases (a ≤ 20, m ≤ 1000), all H = 1
Lemma 3 (BCT-Perfectness Inheritance)
n = 2^a · m is BCT-perfect ⟺ m is BCT-perfect
Verified: 8,769 composite numbers (n < 10⁴), 0 violations
Lemma 4 (Characterization of Sparse Odd Primes)
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
Theorem 1 (Upper Bound)
For any factorization n = a × b:
H(a, b) ≤ min(popcount(a), popcount(b))
Verified: 483,533 factorizations (n ≤ 10⁵), 0 violations
Theorem 2 (Self-Convolution Upper Bound)
H(n²) := H(n, n) ≤ popcount(n)
Verified: 99,999 integers (n ≤ 10⁵), 0 violations
Theorem 3 (Equality Condition)
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!)
Theorems 4-5 (Mersenne Properties)
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
Theorem 6 (Fermat Minimum Resonance)
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!) |
Theorem 7 (Single-Sweep Normalization)
L(a, b) = 1 for all factorizations (sequential LSB→MSB model)
Verified: 16,723 factorizations (n ≤ 5,000), all L = 1
Proposition 5 (Arbitrarily Long Parallel Chains)
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!
Theorem 8 (Even Perfect Number Structure)
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 |
Theorem 9 (Fermat Prime Orthogonality)
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.
Theorem 10 (Structure of BCT-Perfect Odd Numbers)
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⁵)
Theorem 11 (Abundance Bounds)
(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
Theorem 12 (Semiprime Obstruction)
An odd perfect number cannot be a squarefree semiprime pq
Verified: Follows from Theorem 11(a) since 1.6 < 2
Theorem 13 (BCT Obstruction for Odd Perfect Numbers)
No odd BCT-perfect composite n < 10⁶ satisfies σ(n)/n = 2
Verified: 2,017 BCT-perfect odd composites (n < 10⁶), all σ/n < 1.71
Conjecture 1 (BCT-Perfect Odd Abundance Bound)
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}
Complete Verification Summary
| 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 |
Running Verification
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_theorems
Core API
Binary Utilities (src/core/binary_utils.py)
bin_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 number
BCT Invariants (src/core/bct_invariants.py)
H(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
Implementation Notes
Bit Ordering Convention
- 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ⁱ
Verification Ranges
All verifications use ranges matching or exceeding those in the paper's Table 4.
Citation
Software
@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}
}
License
MIT License - see LICENSE for details.
Author
Masamichi Iizumi
Tamaki Iizumi
Miosync, Inc., Tokyo, Japan
m.iizumi@miosync.email
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file binary_convolution_theory-1.0.2.tar.gz.
File metadata
- Download URL: binary_convolution_theory-1.0.2.tar.gz
- Upload date:
- Size: 45.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7505078301bc581375379de1dfc8927aa24d7a662cb9c8ce0fa12f0bf7b3ce5a
|
|
| MD5 |
75b23036b8b9a217cf02617bee419b1e
|
|
| BLAKE2b-256 |
51184b06fe03df35d74933de7d27b8d7da1ca6f56deb269529ba8f23d5428003
|
Provenance
The following attestation bundles were made for binary_convolution_theory-1.0.2.tar.gz:
Publisher:
publish.yml on miosync-masa/BinaryConvolutionTheory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
binary_convolution_theory-1.0.2.tar.gz -
Subject digest:
7505078301bc581375379de1dfc8927aa24d7a662cb9c8ce0fa12f0bf7b3ce5a - Sigstore transparency entry: 814663555
- Sigstore integration time:
-
Permalink:
miosync-masa/BinaryConvolutionTheory@f62b453c6313d281e5d38765f5f5471e905f15c2 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/miosync-masa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f62b453c6313d281e5d38765f5f5471e905f15c2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file binary_convolution_theory-1.0.2-py3-none-any.whl.
File metadata
- Download URL: binary_convolution_theory-1.0.2-py3-none-any.whl
- Upload date:
- Size: 50.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43f6b60475ae570fc17f549738c308db8740583fdb02c3f62346fd8c81ca9ffd
|
|
| MD5 |
b8fad007ec01d8679e698325db61fcbb
|
|
| BLAKE2b-256 |
34a9b7cf84f3a0c64318d034f08c86d9421f6298f643dcb43159c968ed618360
|
Provenance
The following attestation bundles were made for binary_convolution_theory-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on miosync-masa/BinaryConvolutionTheory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
binary_convolution_theory-1.0.2-py3-none-any.whl -
Subject digest:
43f6b60475ae570fc17f549738c308db8740583fdb02c3f62346fd8c81ca9ffd - Sigstore transparency entry: 814663557
- Sigstore integration time:
-
Permalink:
miosync-masa/BinaryConvolutionTheory@f62b453c6313d281e5d38765f5f5471e905f15c2 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/miosync-masa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f62b453c6313d281e5d38765f5f5471e905f15c2 -
Trigger Event:
release
-
Statement type: