Factorization of numbers (option 2)

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

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

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


    341341341341341341341341341341341341341341341341341
    3342716329th12eleventhirteen91713342716329th12eleventhirteen91713342716329th12eleventhirteen9
    3298eleven229th18162242313298eleven229th18162242313298eleven229th1816224
    31166eleven26131166eleven26131166eleven26131166eleven26131166eleven26131166eleven
    thirty25fifteenthirty25fifteenthirty25fifteenthirty25fifteenthirty25fifteenthirty25fifteenthirty25fifteenthirty25fifteenthirty25fifteenthirty25fifteenthirty25fifteenthirty
    29th129th129th129th129th129th129th129th129th129th129th129th129th129th129th129th129th1
    281472128147212814721281472128147212814721281472128147212814
    2729ththirteen12729ththirteen12729ththirteen12729ththirteen12729ththirteen12729ththirteen12729ththirteen12729ththirteen12729th
    26eleven61631126eleven61631126eleven61631126eleven61631126eleven61631126eleven616
    25thirtyfifteen25thirtyfifteen25thirtyfifteen25thirtyfifteen25thirtyfifteen25thirtyfifteen25thirtyfifteen25thirtyfifteen25thirtyfifteen25thirtyfifteen25thirtyfifteen25
    241634eleven191241634eleven191241634eleven191241634eleven191241634eleven191241634eleven
    23422161829th2eleven8932123422161829th2eleven8932123422161829th2eleven89
    2229th812229th812229th812229th812229th812229th812229th812229th812229th
    21212121212121212121212121212121212121212121212121212121212121212121
    20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen20fifteen
    19eleven341624119eleven341624119eleven341624119eleven341624119eleven341624119eleven3416
    18922eleven2329th3216842118922eleven2329th3216842118922eleven2329th321684
    179thirteeneleven1229th316274331179thirteeneleven1229th316274331179thirteeneleven1229th316274
    16eleven116eleven116eleven116eleven116eleven116eleven116eleven116eleven116eleven116eleven116eleven116
    fifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteenfifteen
    14211421142114211421142114211421142114211421142114211421142114211421
    thirteen29th271thirteen29th271thirteen29th271thirteen29th271thirteen29th271thirteen29th271thirteen29th271thirteen29th271thirteen29th
    124thirteen161729th33eleven27931124thirteen161729th33eleven27931124thirteen161729th33eleven279
    eleven161eleven161eleven161eleven161eleven161eleven161eleven161eleven161eleven161eleven161eleven161eleven
    10thirty20255fifteen10thirty20255fifteen10thirty20255fifteen10thirty20255fifteen10thirty20255fifteen10thirty2025
    9eleven29th16419eleven29th16419eleven29th16419eleven29th16419eleven29th16419eleven29th16
    829th221829th221829th221829th221829th221829th221829th221829th221829th
    71428217142821714282171428217142821714282171428217142821714
    6161616161616161616161616161616161
    52520thirty10fifteen52520thirty10fifteen52520thirty10fifteen52520thirty10fifteen52520thirty10fifteen52520thirty
    41629theleven9141629theleven9141629theleven9141629theleven9141629theleven9141629theleven
    3927eleven3329th1716thirteen41213927eleven3329th1716thirteen41213927eleven3329th1716thirteen4
    248163229th23eleven229181248163229th23eleven229181248163229th23eleven229
    1111111111111111111111111111111111

    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 are sure to be two columns in which the remaining values ​​are 1 . In fig. 1 are columns with numbers 12 , 24 .

    From these two columns, the highest column number is equal to the product of (x - 1) to (y - 1) , where x and y divisors of 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) .

    The indicated regularities make it possible to compose 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 the quadratic equation (2) .

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

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

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

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

    i.e. 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 the reciprocal of c . For a composite number A equal to the product of the prime 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 relative to the column with the number ѱ (n ) .

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

    Consider the sequence of actions for finding ѱ (n) .

    1. Reduce the search range. From (A - 1), we take the value of the square root of A calculated to the nearest integer. Denote the result obtained by ѱ 1 .

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

    3. Find the number d = inv (s) . You can find using the extended Euclidean algorithm [4].

    4. Let us power balances for d , since the exponent 1 and ending with some number m , less than or equal to the square root of A .

    5. Found power balances put in an array denoted by M . Array Msort by ascending and index by degree.

    6. Compute the residue from c in degrees ѱ 1 divided by A and to compare the values of M .

    7. If there are no matches, subtract m from ѱ 1 and assign the resulting value to ѱ 1 . Next, repeat paragraphs 6 and 7 until matches occur. 8. If there are matches, we subtract from ѱ 1 the magnitude of the degree index, which coincides with the value of the array M , assign the resulting value

    ѱ 1 .

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

    Here's how it works. From (A - 1) = 34 (Fig. 1) we subtract the square root of 35 , i.e. 5 , we get 29 . For c, choose 18 . We 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 . From29 need to be taken away 5 . The resulting value of 24 is ѱ (n) . Next, substitute A and ѱ (n) in formula (2) and find y . y 1 = 7 , y 2 = 5 .

    Another example.

    2 to the 11th degree, minus 1 is 2047.
    2047 = 23 * 89
    2047/3 = 682 and the remainder is 1
    s = 682, inv (s) = 3
    The square root of 2047 = 45, the remainder is 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 in the degree of 2002 is divided by 2047, the remainder is 1013. inv (1013) = 1657, there are no matches in the array,
    2002 - 20 = 1982
    682 in the degree of 1982 is divided by 2047, the remainder is 524. inv (524) = 1504, there are no matches in the array ,
    1982 - 20 = 1962
    682 in the degree of 1962 we divide by 2047, the remainder 71. inv (71) = 173, there are no matches in the array,
    1962 - 20 = 1942
    682 in the degree of 1942 we divide by 2047, the remainder 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 Function”, en.wikipedia.org/wiki/Euler_Function .
    3. “Return number”, ru.wikipedia.org/wiki/Return_number
    4. “Public key cryptography”, ikit.edu.sfu-kras.ru/files/15/l5.pdf

    Also popular now: