The Innovative Structural Independence from the Absolute Value in the
MFP Method
Author: Marlon Fernando Polegato
Abstract
This article presents a formal analysis of the core innovation of the MFP Method (Pattern-
Based Factorization Method), which lies in its independence from the absolute value of the
number under test. By operating with redistributive decimal projections and a fixed set of
multipliers, the method transforms the problem of primality verification into a structural
and modular process, breaking with the traditional dependency on the magnitude of n. The
article formalizes this property, presents complete formulations, and demonstrates why
this approach is a significant contribution to number theory and symbolic computation.
1. Introduction
Traditional primality tests usually depend on the magnitude of the number. The MFP
Method introduces a paradigm shift by treating large numbers with the same operational
structure applied to small numbers. The definitions are formalized below, highlighting the
main structural innovation.
2. Definitions and Formulations of the MFP Method
Let n > 1 be an integer. Define a fixed set of multipliers: k {3, 7, 9, 11, 1}. For each k:
- Projected product: nk = n × k
- Decimal projection: A = floor(nk / 10)
- Decimal remainder: d₀ = nk mod 10
- Candidate divisors: d = d₀ + 10·i
Stopping criteria:
- If d > A or d > sqrt(nk), stop the process.
Composition criterion:
- If d > 1 and A mod d = 0, compute q = A / d
- If q > 1 and n mod d = 0, then d is a real divisor of n.
3. Structural Innovation: Independence from |n|
The MFP method avoids direct use of the absolute value of n by operating in a redistributive
decimal projection. The number n is transformed via nk = n·k and then projected as A =
floor(nk / 10). All subsequent operations act solely on A and its multiples. The process is
guided by modular and redistributive relations, not by the size of n.
4. Properties and Formal Proofs
Property 1: The modular projection of nk reduces n into a normalized decimal space.
Property 2: The classes d = d₀ + 10·i are closed and tested only up to A or sqrt(nk).
Property 3: If d divides both A and n, it is a real divisor, identified without external
factorization.
Thus, we obtain a deterministic and structural verification of the composition of n.
5. Parallelism and Scalability
Each multiplier k can be handled in a separate thread, enabling natural parallelization. The
independence between threads makes the method efficient on multi-core devices. No k
interferes with another, and the first one to find a divisor halts the execution.
6. Experimental Results
#include <gmp.h>
#include <iostream>
#include <vector>
#include <thread>
#include <mutex>
#include <chrono>
#include <cmath>
#include <string>
Using namespace std;
Using namespace std::chrono;
Mutex resultado_mutex;
Bool encontrado = false;
Void print_mpz(const mpz_t x) {
Char *str = mpz_get_str(nullptr, 10, x);
If (!str) {
Cout << “(erro ao converter)”;
Return;
}
Cout << str;
Free(str);
}
Void str_to_mpz(const string &s, mpz_t out) {
Mpz_set_str(out, s.c_str(), 10);
}
Void testar_k(const mpz_t n, int k, mpz_t divisor_global) {
If (encontrado) return;
Mpz_t nk, A, d, q, sqrt_nk;
Mpz_inits(nk, A, d, q, sqrt_nk, nullptr);
Mpz_mul_ui(nk, n, k);
Mpz_sqrt(sqrt_nk, nk);
Mpz_fdiv_q_ui(A, nk, 10);
Unsigned long d0 = mpz_fdiv_ui(nk, 10);
Mpz_t i_max_mpz;
Mpz_init(i_max_mpz);
Mpz_fdiv_q_ui(i_max_mpz, sqrt_nk, 10);
Unsigned long i_max = mpz_get_ui(i_max_mpz);
Mpz_clear(i_max_mpz);
For (unsigned long I = 0; I <= i_max && !encontrado; i++) {
Unsigned long d_val = d0 + 10ULL * I;
Mpz_set_ui(d, d_val);
If (mpz_cmp_ui(A, d_val) < 0 || mpz_cmp_ui(sqrt_nk, d_val) < 0) break;
If (d_val > 1 && mpz_fdiv_ui(A, d_val) == 0) {
Mpz_fdiv_q_ui(q, A, d_val);
If (mpz_cmp_ui(q, 1) > 0 && mpz_divisible_ui_p(n, d_val)) {
Lock_guard<mutex> lock(resultado_mutex);
If (!encontrado) {
Mpz_set_ui(divisor_global, d_val);
Encontrado = true;
}
Break;
}
}
Mpz_sub_ui(A, A, 1);
If (mpz_sgn(A) <= 0) break;
}
Mpz_clears(nk, A, d, q, sqrt_nk, nullptr);
}
Bool mfp_test_gmp_parallel(const mpz_t n, mpz_t divisor) {
Encontrado = false;
If (mpz_cmp_ui(n, 2) < 0) {
Mpz_set(divisor, n);
Return false;
}
If (mpz_cmp_ui(n, 5) == 0) return true;
If (mpz_fdiv_ui(n, 10) == 5) {
Mpz_set_ui(divisor, 5);
Return false;
}
Const int ks[] = {1, 3, 7, 9, 11};
Vector<thread> threads;
For (int k : ks) {
Threads.emplace_back(testar_k, n, k, divisor);
}
For (auto &t : threads) t.join();
Return !encontrado;
}
Int main() {
Vector<string> numeros = {
“11”, “15”, “31”, “91”,
“2199023255551”,
“9007199254740991”,
“147573952589676412927”,
“590295810358705651711”,
“9444732965739290427391”,
“1981021330821525328145227497401641797777993777771111111111199999999”,
“1522605027922533360535618378132637429718068114961380688657908494580122
963258952897654000350692006139”
};
For (auto &snum : numeros) {
Mpz_t n, divisor;
Mpz_inits(n, divisor, nullptr);
Str_to_mpz(snum, n);
Auto start = high_resolution_clock::now();
Bool is_prime = mfp_test_gmp_parallel(n, divisor);
Auto end = high_resolution_clock::now();
Double tempo = duration<double>(end start).count();
Cout << “Número: “ << snum << “\n”;
If (is_prime) {
Cout << “MFP: Primo | Tempo: “ << tempo << “ s\n”;
} else {
Cout << “MFP: Composto (“;
Print_mpz(divisor);
Cout << “) | Tempo: “ << tempo << “ s\n”;
}
Cout << “--------------------------\n”;
Mpz_clears(n, divisor, nullptr);
}
Return 0;
}
R:
Number: 11
MFP: Prime | Time: 0.00275638 s
Number: 15
MFP: Composite (5) | Time: 1.539e-06 s
Number: 31
MFP: Prime | Time: 0.00156638 s
Number: 91
MFP: Composite (13) | Time: 0.000766539 s
Number: 2199023255551
MFP: Composite (13367) | Time: 0.003693 s
Number: 9007199254740991
MFP: Composite (6361) | Time: 0.00334085 s
Number: 147573952589676412927
MFP: Composite (193707721) | Time: 1.34199 s
Number: 590295810358705651711
MFP: Composite (7) | Time: 0.00157423 s
Number: 9444732965739290427391
MFP: Composite (439) | Time: 0.00299592 s
Number:
1981021330821525328145227497401641797777993777771111111111199999999
MFP: Composite (3467) | Time: 0.00294654 s
7. Conclusion
The key innovation of the MFP method lies in its independence from the absolute value of n.
The use of decimal redistributions and internal structural criteria allows the identification
of composites without relying on factorization, prime generation, or √n limits. This
paradigm shift paves the way for deterministic and scalable algorithms, applicable even in
cryptographic contexts.
8. Future Work
- Deepen the predictive use of A and d structures;
- Generalize the method for complete factor extraction through redistribution;
- Explore applications in RSA key security analysis;
- Formalize a complete modular theory of numerical composition based on decimal
redistribution.
9. AGRADECIMENTOS
Agradeço ao Grande Arquiteto do Universo, aos meus pais, Helvio Polegato e Fátima I. L.
Polegato a minha esposa Tayrine S. B. Polegato aos amigos e familiares que me apoiaram
nessa jornada.
References
1. Riesel, H. (2008). *Prime Numbers and Computer Methods for Factorization*.
2. Apostol, T.M. (1976). *Introduction to Analytic Number Theory*.
3. Ribenboim, P. (1989). *The Book of Prime Number Records*.
4. Polegato, M.F. (2024). *Redistribuição Decimal e Detecção de Primalidade*.
5. Polegato, M.F. (2024). *Método Modular 12*. Núcleo do Conhecimento.
6. Polegato, M.F. (2022). *Fermat’s Library* https://fermatslibrary.com/p/2e0648ef
7. Polegato, M.F. (2024). *Fermat’s Library* https://fermatslibrary.com/p/f6e5695