Delta Sieve Factoring Method example implementation with optimizations.
DeltaSifter is a Python implementation of the Delta Sieve Factoring Method (DSFM), an algorithm for integer factorization. The implementation includes various optimizations while maintaining readability and educational value.
For detailed description of the algorithm, see:
- Optimized implementation of the Delta Sieve Factoring Method
- Quasi-parallel processing with multiple computation streams
- Detailed progress reporting
- Intermediate calculations visualization (candidate divisors)
Clone the repository:
git clone https://github.com/ooptimum/delta-sifter.git
cd delta-sifter
Basic usage:
from sifter import factorize
# Factorize a number
factorize(1234567)
Command line usage:
python sifter.py 1234567
Optional arguments:
--continue
: Continue searching after finding the first result--trace
: Print candidate divisors at each step
Searching for factors of 1234567
Step 1: n=0, δ=6, m²=4938304, p=1114.11, q=1108.11
Step 2: n=6, δ=6, m²=4972864, p=1208.00, q=1022.00
...
Found divisors p=127, q=9721 at step 165 (took 0.00 seconds)
n = -320
δ = 6
m² = 96983104
- Python >= 3.8
This project is licensed under the Creative Commons Attribution 4.0 International License.
This project is provided for educational and research purposes only.
There is no guarantee of correctness, performance, or fitness for any particular purpose.
The author is not responsible for any use, misuse, or damages resulting from the use of this code.
Use at your own risk.