📜 ⬆️ ⬇️

Factorization of numbers (option 2)

I would like to bring to your attention one of the variants of the composite number factorization algorithm.

To simplify, we consider the matrix of residuals of the composite number A = 35 , as well as in [1], presented in Fig. 1.

As already mentioned [1], the table of power residues of the composite number A (Fig. 1) has certain features.
')

34one34one34one34one34one34one34one34one34one34one34one34one34one34one34one34one34one
33four27sixteen32912eleven13917one33four27sixteen32912eleven13917one33four27sixteen32912eleven139
329eighteleven22918sixteen22four23one329eighteleven22918sixteen22four23one329eighteleven22918sixteen22four
31sixteen6eleven26one31sixteen6eleven26one31sixteen6eleven26one31sixteen6eleven26one31sixteen6eleven26one31sixteen6eleven
thirty2515thirty2515thirty2515thirty2515thirty2515thirty2515thirty2515thirty2515thirty2515thirty2515thirty2515thirty
29one29one29one29one29one29one29one29one29one29one29one29one29one29one29one29one29one
281472128147212814721281472128147212814721281472128147212814
272913one272913one272913one272913one272913one272913one272913one272913one2729
26eleven6sixteen31one26eleven6sixteen31one26eleven6sixteen31one26eleven6sixteen31one26eleven6sixteen31one26eleven6sixteen
25thirty1525thirty1525thirty1525thirty1525thirty1525thirty1525thirty1525thirty1525thirty1525thirty1525thirty1525
24sixteen34elevennineteenone24sixteen34elevennineteenone24sixteen34elevennineteenone24sixteen34elevennineteenone24sixteen34elevennineteenone24sixteen34eleven
23four22sixteen18292eleveneight932one23four22sixteen18292eleveneight932one23four22sixteen18292eleveneight9
2229eightone2229eightone2229eightone2229eightone2229eightone2229eightone2229eightone2229eightone2229
21212121212121212121212121212121212121212121212121212121212121212121
20152015201520152015201520152015201520152015201520152015201520152015
nineteeneleven34sixteen24onenineteeneleven34sixteen24onenineteeneleven34sixteen24onenineteeneleven34sixteen24onenineteeneleven34sixteen24onenineteeneleven34sixteen
18922eleven232932sixteeneightfour2one18922eleven232932sixteeneightfour2one18922eleven232932sixteeneightfour
17913eleven12293sixteen27four33one17913eleven12293sixteen27four33one17913eleven12293sixteen27four
sixteenelevenonesixteenelevenonesixteenelevenonesixteenelevenonesixteenelevenonesixteenelevenonesixteenelevenonesixteenelevenonesixteenelevenonesixteenelevenonesixteenelevenonesixteen
15151515151515151515151515151515151515151515151515151515151515151515
14211421142114211421142114211421142114211421142114211421142114211421
132927one132927one132927one132927one132927one132927one132927one132927one1329
12four13sixteen172933eleven2793one12four13sixteen172933eleven2793one12four13sixteen172933eleven279
elevensixteenoneelevensixteenoneelevensixteenoneelevensixteenoneelevensixteenoneelevensixteenoneelevensixteenoneelevensixteenoneelevensixteenoneelevensixteenoneelevensixteenoneeleven
tenthirty2025five15tenthirty2025five15tenthirty2025five15tenthirty2025five15tenthirty2025five15tenthirty2025
9eleven29sixteenfourone9eleven29sixteenfourone9eleven29sixteenfourone9eleven29sixteenfourone9eleven29sixteenfourone9eleven29sixteen
eight2922oneeight2922oneeight2922oneeight2922oneeight2922oneeight2922oneeight2922oneeight2922oneeight29
71428217142821714282171428217142821714282171428217142821714
6one6one6one6one6one6one6one6one6one6one6one6one6one6one6one6one6one
five2520thirtyten15five2520thirtyten15five2520thirtyten15five2520thirtyten15five2520thirtyten15five2520thirty
foursixteen29eleven9onefoursixteen29eleven9onefoursixteen29eleven9onefoursixteen29eleven9onefoursixteen29eleven9onefoursixteen29eleven
3927eleven332917sixteen13four12one3927eleven332917sixteen13four12one3927eleven332917sixteen13four
2foureightsixteen322923eleven22918one2foureightsixteen322923eleven22918one2foureightsixteen322923eleven229
oneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneoneone

Fig. 1 Table of power residues of the composite number A = 35 .

If we exclude rows whose values ​​are multiples of the divisors of the number A , then there will necessarily be two columns in which the remaining values ​​are 1 . In fig. 1 is the columns with numbers 12 , 24 .

Of these two columns, the largest column number is equal to the product (x - 1) by (y - 1) , where x and y are divisors of the number A. It should be noted that in this case, the column number 24 is equal to the value of the Euler function [2], the value of which is
(x - 1) * (y - 1) = ѱ (n) .

The difference between the number A and the Euler function ѱ (n) is (x + y - 1) .

These patterns allow us to make a system of equations.

Ѱ (n) = (x - 1) * (y - 1)
A - ѱ (n) = (x + y - 1)
Formula 1)

Using substitutions, the system of equations (1) can be reduced to a quadratic equation (2).

y 2 - (A - ѱ (n) + 1) y + A = 0
Formula (2)

To successfully solve this equation, only (n) is missing.

We consider additionally the properties of the power residuals of the number A of the table (Fig. 1). We introduce the concept of inverse value [3]. If you choose the value of c from the range of numbers (1, A - 1) , so that c does not have multiple divisors of x and y , then there is always the value d , from the same range (1, A - 1) , such that

c * d ≡ 1 (mod A)
Formula (3)

those. c * d = nA + 1 , where n can take values ​​from 1 to (A - 2) .

We introduce the notation d = inv (c) , i.e. d is equal to the inverse of c . For a composite number A , equal to the product of simple factors x and y , the number of pairs of inverse values ​​is

(A - (x - 1) - (y - 1) - 1) / 2
Formula (4)

The inverse values, in the rows of the table (Fig. 1), are located symmetrically with respect to the column with the number ѱ (n) .

The inverse values, in the columns of the table (Fig. 1), are arranged symmetrically with respect to pairs of inverse values ​​in the first column.

Consider the sequence of actions to find ѱ (n) .

1. Reduce the search range. From (A - 1) we subtract the value of the square root of A , calculated up to integer. The result is denoted by 1 .

2. Choose a number c , not a multiple of the divisors x , y of the number A. It is desirable that the power residues of c have the minimum number of duplicate values.

3. Find the number d = inv (c) . You can find it using the advanced Euclidean algorithm [4].

4. Find the power residues for d , starting with exponent 1 and ending with some number m , less than or equal to the square root of A.

5. We put the power residues found in the array; we denote it by M. The array M is sorted in ascending order and indexed by exponent.

6. Calculate the remainder of c to the power ѱ 1 divided by A and compare with the values ​​of M.

7. In the absence of coincidence, from 1 subtract m and assign the resulting value to ѱ 1 . Next, repeat paragraph 6 and 7 until a match appears.

8. In the presence of coincidences, from ѱ 1 we subtract the value of the index of the degree that matched the values ​​of the array M , assign the resulting value to 1 .

In this case, ѱ 1 = ѱ (n) .

Here is how it works. From (A - 1) = 34 (Fig. 1) we take away the square root of 35 , i.e. 5 , we get 29 . As c, select 18 . Find inv (18) = 2 . If m = 5 , then the array M = {2, 4, 8, 16, 32} . The remainder of 18 , to the power of 29 , divided by 35 , is 23 . inv (23) = 32 . This value is in the array and the index is 5 . From 29 you need to subtract 5 . The resulting value of 24 is ѱ (n) . Next, we substitute A and ѱ (n) into formula (2) and find y . y 1 = 7 , y 2 = 5 .

Another example.

2 to the 11th degree, minus 1 equals 2047.
2047 = 23 * 89
2047/3 = 682 and the remainder 1
c = 682, inv (c) = 3
The square root of 2047 = 45, the remainder 22.
2047 - 45 = 2002
m = 20
M = {3, 9, 27, 81, 243, 729, 140, 420, 1260, 1733, 1105, 1268, 1757, 1177, 1484, 358, 1074, 1175, 1478, 340}
682 to the power of 2002 divided by 2047, the remainder 1013. inv (1013) = 1657, there are no matches in the array,
2002 - 20 = 1982
682 to the power of 1982 divided by 2047, the remainder 524. inv (524) = 1504, there are no matches in the array,
1982 - 20 = 1962
682 to the power of 1962 divided by 2047, the remainder 71. inv (71) = 173, there are no matches in the array,
1962 - 20 = 1942
682 to the power of 1942 is divided by 2047, the remainder is 1623. inv (1623) = 729, there are matches in the array, the index is 6
1942 - 6 = 1936 = ѱ (n)
y 2 - (2047 - 1936 + 1) y + 2047 = 0
y 2 - 112y + 2047 = 0
y 1 = 89
y 2 = 23

Literature.
1. “Symmetry of numbers”, habrahabr.ru/post/218053 .
2. “Euler's function“, ru.wikipedia.org/wiki/Eyler_Function .
3. “Inverse number”, ru.wikipedia.org/wiki/Final_number
4. “Public-key cryptography”, ikit.edu.sfu-kras.ru/files/15/l5.pdf

Source: https://habr.com/ru/post/270949/


All Articles