![]() |
|
|
#1 |
|
"ม้าไฟ"
May 2018
53410 Posts |
An illustration of the factorization of Mersenne numbers as a constrained optimization problem is given for
M11=211-1=2047=111111111112 with BitLength[M11]=11. One has to start with an assumption about the number of bits necessary to represent a prospective factor a. Let's assume that BitLength[a]=5. Therefore, M11 = ab and BitLength[b]=11-5+1=7. In polynomial form, x10+x9+x8+x7+x6+x5+x4+x3+x2+x+1 = (x4+a3x3+a2x2+a1x+1)(x6+b5x5+b4x4+b3x3+b2x2+b1x+1), and the binary vectors are a=(1,a3,a2,a1,1) and b=(1,b5,b4,b3,b2,b1,1) where 0≤a3+b5≤1 and a1+b1=1. The expansion of the polynomial product gives x10+x9+x8+x7+x6+x5+x4+x3+x2+x+1 = x10+(a3+b5)x9+(b4+a3b5+a2)x8+(b3+a3b4+a2b5+a1)x7+(b2+a3b3+a2b4+a1b5+1)x6+(b1+a3b2+a2b3+a1b4+b5)x5+(1+a3b1+a2b2+a1b3+b4)x4+(a3+a2b1+a1b2+b3)x3+(a2+a1b1+b2)x2+(a1+b1)x+1 An implementation in Wolfram code Code:
FindInstance[
2^10 + (ca3 + cb5)*2^9 + (cb4 + ca3*cb5 + ca2)*2^8 + (cb3 + ca3*cb4 +
ca2*cb5 + ca1)*2^7 + (cb2 + ca3*cb3 + ca2*cb4 + ca1*cb5 +
1)*2^6 + (cb1 + ca3*cb2 + ca2*cb3 + ca1*cb4 + cb5)*2^5 + (1 +
ca3*cb1 + ca2*cb2 + ca1*cb3 + cb4)*2^4 + (ca3 + ca2*cb1 +
ca1*cb2 + cb3)*2^3 + (ca2 + ca1*cb1 + cb2)*2^2 + (ca1 +
cb1)*2 + 1 == 2^11 - 1 && ca3 + cb5 <= 1 && ca1 + cb1 == 1 &&
ca1 <= 1 && ca2 <= 1 && ca3 <= 1 && cb1 <= 1 && cb2 <= 1 &&
cb3 <= 1 && cb4 <= 1 && cb5 <= 1, {ca3, ca2, ca1, cb5, cb4, cb3,
cb2, cb1}, NonNegativeIntegers]
Code:
{{ca3 -> 0, ca2 -> 1, ca1 -> 1, cb5 -> 0, cb4 -> 1, cb3 -> 1, cb2 -> 0, cb1 -> 0}}
|
|
|
|
|
|
#2 |
|
"Robert Gerbicz"
Oct 2005
Hungary
3·547 Posts |
And of course this is not a simplification of the problem, because it is a quadratic optimization problem using binary integers.
And I'd prefer this (known) form: min{0 : x*y=n, x>=2, y>=2, x and y are integers}, it is feasible iff n is composite, and for composites it will give a non-trivial divisor of n [and with that you can factor n fully recursively]. |
|
|
|
|
|
#3 |
|
"ม้าไฟ"
May 2018
2×3×89 Posts |
The illustration in post #1 is not a simplification indeed.
The approach is to be further expanded in at least three directions as follows: 1) Addition of heuristic constraints (for example, b1+a3b2+a2b3+a1b4+b5≤2, etc.); 2) Use of evolutionary computation and genetic algorithms, like GENOCOP for numerical optimization problems; and 3) Preparation of a quadratic function to be tried on a quantum annealing computer like D-Wave Systems. Last fiddled with by Dobri on 2022-04-11 at 15:30 |
|
|
|
|
|
#4 | |
|
"Robert Gerbicz"
Oct 2005
Hungary
66916 Posts |
Quote:
I'd say it is quite unlikely that the quad binary approach would be in polynomial time using quantum [because the above form is from ancient]. |
|
|
|
|
|
|
#5 |
|
"ม้าไฟ"
May 2018
2×3×89 Posts |
Shor's algorithm can be implemented on quantum computers like IBM Quantum where the problem is the limited number of qubits and the noise.
Quantum annealing is kind of pseudo-quantum computing for solving optimization problems having the advantage of the utilization of large matrix qubit configurations. There are several works on integer factorization using D-Wave Systems but not much is known about the efficiency of factoring Mersenne numbers. A short video that illustrates the classical idea for such optimizations is available at https://www.youtube.com/watch?v=dAyDi1aa40E. Last fiddled with by Dobri on 2022-04-11 at 16:09 |
|
|
|
|
|
#6 |
|
"ม้าไฟ"
May 2018
2×3×89 Posts |
Below is a more compact Wolfram code which allows one to enter the bit length Mbl of the Mersenne number and the bit length Fbl of the prospective factor.
For this second illustration, M29=229-1=536870911=111111111111111111111111111112 is chosen (Mbl=29) and it is assumed that the bit length of the prospective factor is Fbl=11. Code:
Mbl = 29; Fbl = 11;
FindInstance[(2^(Fbl - 1) + 1 +
Sum[Boole[ca[i]]*2^i, {i, 1, Fbl - 2, 1}])*(2^(Mbl - Fbl) + 1 +
Sum[Boole[cb[i]]*2^i, {i, 1, Mbl - Fbl - 1, 1}]) == 2^Mbl - 1 &&
Boole[ca[Fbl - 2]] + Boole[cb[Mbl - Fbl - 1]] <= 1 &&
Boole[ca[1]] + Boole[cb[1]] == 1, {Sequence @@
Array[ca, {Fbl - 2}, {1}],
Sequence @@ Array[cb, {Mbl - Fbl - 1}, {1}]}, Booleans]
Code:
{{ca[1] -> True, ca[2] -> True, ca[3] -> True, ca[4] -> False,
ca[5] -> False, ca[6] -> True, ca[7] -> False, ca[8] -> False,
ca[9] -> False, cb[1] -> False, cb[2] -> False, cb[3] -> False,
cb[4] -> True, cb[5] -> False, cb[6] -> True, cb[7] -> False,
cb[8] -> True, cb[9] -> False, cb[10] -> True, cb[11] -> True,
cb[12] -> False, cb[13] -> True, cb[14] -> True, cb[15] -> False,
cb[16] -> True, cb[17] -> True}}
Last fiddled with by Dobri on 2022-04-12 at 13:40 |
|
|
|
|
|
#7 |
|
"ม้าไฟ"
May 2018
2·3·89 Posts |
In this third illustration, the optimization is only over the unknown bits of the binary vector a=(1,aFbl-2,...,a1,1).
The Mersenne number M1249=21249-1 is chosen (Mbl=1249) and it is assumed that the bit length of the prospective factor is Fbl=26. The simplified Wolfram code Code:
p = 1249; Mn = 2^p - 1;
Mbl = p; Fbl = 26;
FindInstance[
Mod[Mn, FromDigits[Boole[Reverse[Join[{True},
{Sequence @@ Array[ca, {Fbl - 2}, {1}]}, {True}]]], 2]] == 0,
{Sequence @@ Array[ca, {Fbl - 2}, {1}]}, Booleans]
Code:
{{ca[1] -> False, ca[2] -> False, ca[3] -> False, ca[4] -> False, ca[5] -> False, ca[6] -> True, ca[7] -> True, ca[8] -> True, ca[9] -> True, ca[10] -> False, ca[11] -> True, ca[12] -> False, ca[13] -> True, ca[14] -> True, ca[15] -> True, ca[16] -> False, ca[17] -> True, ca[18] -> True, ca[19] -> True, ca[20] -> True, ca[21] -> False, ca[22] -> False, ca[23] -> False, ca[24] -> True}}
Last fiddled with by Dobri on 2022-04-13 at 04:55 |
|
|
|
|
|
#8 |
|
"Curtis"
Feb 2005
Riverside, CA
2·2,927 Posts |
Please use your method on M1277 and let us know what the factor is.
|
|
|
|
|
|
#9 |
|
"ม้าไฟ"
May 2018
53410 Posts |
|
|
|
|
|
|
#10 | |
|
Feb 2017
Nowhere
13·17·29 Posts |
Quote:
I ran a completely mindless Pari-GP script to look for small factors 2*k*1249 + 1 of 2^1249 - 1 for k <= 1000000. It quickly found 3 small factors (one of which was smaller than the one your program found). I then checked the cofactor, and it tested composite. Code:
? forstep(i=6*1249+1,2000000*1249+1,[2*1249,6*1249],r=Mod(2,i)^1249-1;if(r==0,print(i))) 97423 52358081 2379005273 ? n=(2^1249-1)/97423/52358081/2379005273;ispseudoprime(n) %4 = 0 I suggest you try a bit length of 426. If there is no factor that length or smaller, you will at least have shown that M1277 is a P2. |
|
|
|
|
|
|
#11 | |
|
"ม้าไฟ"
May 2018
10268 Posts |
Quote:
The increase of the bit length increases the computation time exponentially if no additional constraints are stated. For example, one could put constraints on the number of consecutive zeros and ones, add empirical bit patterns, etc., in order to reduce the computation time for a prospective factor. |
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mersenne factorization by (nxy+x+y) | baih | Miscellaneous Math | 7 | 2020-08-25 07:55 |
| Optimization Mersenne search | Kube Prims | GPU Computing | 1 | 2019-11-05 15:40 |
| Transforming the factorization problem into a game | Alberico Lepore | Alberico Lepore | 1 | 2017-09-28 10:14 |
| An equivalent problem for factorization of large numbers | HellGauss | Math | 5 | 2012-04-12 14:01 |
| Fermat numbers factorization | ET_ | Factoring | 15 | 2008-03-12 21:24 |