Author | Zhang Ying
Source | "First Year of Mathematics"
"Dayan Finding One Technique" is an outstanding achievement in ancient Chinese mathematics. It provides an effective method to find the special solution of integers of in binary equations.
This article introduces the algorithm and mathematical principles of "Dayan Find One Technique", which is suitable for middle school students' extracurricular reading.
(a) Why does "Dayan Find One Technique" need?
"Dayan Find One Technique" algorithm is proposed by my country's mathematician Southern Song Dynasty Qin Jiushao in his book "Hangml4 Number Book Nine Chapters " and is used to find the "key numbers" in the "Sun Tzu's Theorem".
Take the "nothing knows the number" problem in " Sun Zi Calculate the Jing " as an example:
It is known that the remainder of the positive integer divided by is , respectively, find the remainder of the division of by .
Suppose that the key number has been obtained to satisfy
. According to the principle of remainder operation, there is

because , respectively , it can be seen that , find , is equivalent to , so that , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , For example, the song written by the Ming Dynasty mathematician Cheng Dawei in "Algorithm Tongzong" is:
Three people travel together with seventy,
Five trees and 21 plum blossoms;
Seven sons reunite in half a month,
Exceeding 105 will be known.
The goal of "Dayan Find One Technique" is to solve this key problem, namely:
solves first congruent equation
where is the positive integer of mutual value .
(Bi) "Dayan Find One Technique" is the point of
For positive integer pairs of mutual elements, the "Dayan Find One Technique" algorithm actually gives a set of non-negative integer solutions to the binary first equation
the previous article "How to find the greatest common factor" ("First Year of Mathematics" public account October 9, 2022). Using the more phase subtraction process of finding the greatest common factor, a simple step-by-step improvement algorithm for finding a set of non-negative integer solutions to the above binary first equation is given.
The reason why Qin Jiushao wanted to create a new algorithm like "Dayan Seek One Technique" is closely related to the calculation technology of ancient Chinese mathematics.
uses calculation to perform a more phase subtraction process to find the greatest common factor, which is inconvenient to retain the intermediate process. Therefore, after the more phase subtraction process is stopped, it is actually impossible to gradually fall back on the improvement solution using the boost algorithm. The advantage of
"Dayan Find One Technique" is that as the transition division progresses,
is obtained and satisfies
in the first step (assuming the remainder is ) and finally, when the transition division stops in the first step (it may need to add a step to adjust the division),
is just obtained, so it is a set of solutions.
(III) "Dayan Find One Technique" algorithm and explanation
Let it be a positive integer of mutual element. The target of the "Dayan Find One Technique" algorithm of
is: find a set of non-negative integer solutions to the equation
algorithm. The result of each step is a table of numbers of two rows and three columns. For example,
, its upper and lower rows meet the conditions respectively:
, the initial state of of
, is set to:
, if , then meet the requirements.
Set the first two steps of
to describe the algorithm according to the and sequential situation.
case :
. Suppose the result of division with remainder divided by :
uses the quotient obtained to multiply the two numbers corresponding to , respectively in the initial number table and add the result to the two numbers corresponding to , and then update , to the remainder to obtain the result of step 1:
is easy to verify, and the meaning of the first row of the number table is:
. If , then the algorithm ends.Suppose the result of the division with remainder divided by :
uses the quotient obtained to multiply the two numbers corresponding to , and add the result to the two numbers corresponding to , and then update to the remainder to obtain the result of step 2:
is easy to confirm, the meaning of the second row of the number table is:
, the situation two :
. Suppose the result of the division with remainder divided by , and use the quotient obtained to multiply the two numbers corresponding to , respectively in the initial number table and add the result to the two numbers corresponding to , and then update to the remainder to obtain the result of step 1:
is easy to confirm, the meaning of the second row of the number table is:
. Suppose the result of the division with remainder to be:
. Suppose the result of the division with remainder is:
. Suppose the result of the division with remainder is:
. Suppose the result of the division with remainder is:
. Suppose the result of the division with remainder is:
. The result of division with remainder is:
uses the quotient obtained to multiply the two numbers corresponding to , and add the result to the two numbers corresponding to , and then update it to the remainder to obtain the result of step 2:
is easy to confirm, and the meaning of the first row of the number table is:
. Generally, the results of each step of the "Dayan Find One Technique" algorithm, or the form of
, respectively, represent the following equation:
or form of
, respectively, represent the following equation:
. This process continues and the conditions for terminating at
are: the number of the right column of the uplink of the number table
. In particular, if the process of dividing and diversion ends at the downlink (at this time) It is necessary to add a "division" artificially. requires that remainder equal to , i.e.:
, where the algorithm terminates immediately, obtain the number table:
, the algorithm terminates : At this time, the number in the right column of the number table is up, so there is the equation
, which gets the non-negative integer solution
, and the note : It should be noted that the initial setting of Qin Jiushao's "Dayan Find One Technique" and the result of each step of operation are two rows and two columns of numbers, and only the required value can be obtained. This article adds an intermediate column to find the value at the same time.
(IV) "Dayan Find One Technique" Example
This section demonstrates the process of the "Dayan Find One Technique" algorithm through examples.
Example 1 finds a set of positive integer solutions.
initial number table
0 | 20 | |
0 | 27 |
0 | 20 | |
7 |
23 | 17 |
0 | 96 | |
0 | 0 | 67 |
29 | ||
0 | 0 | 67 |
29 | |
9 |
7 | 10 |
9 |
7 | 10 |
43 |
37 | 53 |
30 | 43 |