MFP Method for Deterministic
Structural Factorization
Abstract
This article presents a comparison between three distinct versions of the MFP (Pattern-
Based Factorization Method), implemented in C++ using parallelism and optimization
techniques. Each version applies the decimal structure of the number, combined with
multiple k in {1, 3, 7, 9}, and a redistribution based on the equation n*k = 10*A + d0. The
goal is to evaluate computational efficiency, complete factorization capability, and the
reliability of the extracted divisors.
Code 1: MFP with GMP, i Blocks, and Dynamic Parallelism
Structure: Uses threads with distribution of i blocks. The variable nk = n * k is used to derive
the decimal base A and digit d0. Each divisor is tested in the form d = d0 + 10*i.
Formulations and Logic:
1. Compute nk = n * k
2. Derive A and d0: nk = 10*A + d0
3. For each i, form d = d0 + 10*i
4. Check two conditions simultaneously:
- A - i is divisible by d (i.e., A mod d = i mod d)
- n is divisible by d
Formal Demonstration:
If n*k = 10*A + d0 then any divisor d of n must satisfy the congruence A - i ≡ 0 mod d for
some i such that d = d0 + 10*i. This reduces the search space for real divisors to an
arithmetic sequence.
#include <cstddef>
#include <iostream>
#include <vector>
#include <thread>
#include <atomic>
#include <mutex>