Number Theory-China Residue Theorem

Source: Internet
Author: User

I have heard the name of the remainder theorem, but I also know a little bit about it ..

But I have studied it carefully today .. Leave this post to note.
Reference: http://eblog.cersp.com/userlog/7978/archives/2008/723693.shtml
Http://book.51cto.com/art/200812/102579.htm

Example 1: What is the minimum value of A number divided by 3 to 1, 4 to 2, and 5 to 4?
The numbers 3, 4, and 5 are mutually qualitative.
Then [4, 5] = 20; [3, 5] = 15; [3, 4] = 12; [3, 4, 5] = 60.
In order to divide 20 by 3 and 1, 20 × 2 = 40;
So that 15 is divided by 4 and 1, 15 × 3 = 45;
So that 12 is divided by 5 to 1, with 12 × 3 = 36.
Then, 40 × 1 + 45 × 2 + 36 × 4 = 274,
Because, 274> 60, so, 274-60 × 4 = 34, is the number of requests.

Example 2: What is the minimum value of A number divided by 3, 2, 7, 4, and 8?
The numbers 3, 7, and 8 are mutually qualitative.
Then [168] = 56; [] = 24; [] = 21; [, 8] =.
In order to divide 56 into 3 and 1, 56 × 2 = 112 is used;
In this case, 24x5 = 120 is used for Division of 24 by 7 and 1.
So that 21 is divided by 8 and 1, 21 × 5 = 105;
Then, 112 × 2 + 120 × 4 + 105 × 5 = 1229,
Because, 1229> 168, 1229-168 × 7 = 53, is the number of requests.

Example 3: divide a number by 5 plus 4, divide by 8 plus 3, and divide by 11 plus 2 to obtain the minimum natural number that meets the conditions.
The numbers 5, 8, and 11 are mutually qualitative.
Then [8, 11] = 88; [5, 11] = 55; [5, 8] = 40; [5, 8, 11] = 440.
In order to make 88 be divided by 5 and 1, 88 × 2 = 176 is used;
So that 55 is divided by 8 and 1, with 55 × 7 = 385;
So that 40 is divided by 11 and 1 is used, 40 × 8 = 320.
Then, 176 × 4 + 385 × 3 + 320 × 2 = 2499,
Because, 2499> 440, 2499-440 × 5 = 299 is the desired number.

Example 4: A grade student has five more people in a row per 9 people, one more person in a row per 7 people, and two more people in a row per 5 people, how many people are there in this grade? (Questions asked by happy 123)
The numbers 9, 7, and 5 are mutually qualitative.
Then [7, 5] = 35; [9, 5] = 45; [9, 7] = 63; [9, 7, 5] = 315.
In order to divide 35 by 9 to 1, 35x8 = 280 is used;
So that 45 is divided by 7 and 1, with 45 × 5 = 225;
So that 63 is divided by 5 and 1, 63 × 2 = 126.
Then, 280 × 5 + 225 × 1 + 126 × 2 = 1877,
Because, 1877> 315, so, 1877-315 × 5 = 302, is the desired number.

Example 5: There is a grade student. There are 6 more people in each 9-person row. There are 2 more people in each 7-person row, and 3 more people in each 5-person row, how many people are there in this grade? (Questions from teacher zelin)
The numbers 9, 7, and 5 are mutually qualitative.
Then [7, 5] = 35; [9, 5] = 45; [9, 7] = 63; [9, 7, 5] = 315.
In order to divide 35 by 9 to 1, 35x8 = 280 is used;
So that 45 is divided by 7 and 1, with 45 × 5 = 225;
So that 63 is divided by 5 and 1, 63 × 2 = 126.
Then, 280 × 6 + 225 × 2 + 126 × 3 = 2508,
Because, 2508> 315, therefore, 2508-315 × 7 = 303 is the desired number.
(In Example 5 and in example 4, the divisor is the same, and the remainder is the same. The difference is the last two steps .)

 

 

Write a double-digit 62 first, then write the sum of the two numbers in the right end of 62 to 8, get 628, then write the sum of the last two digits 2 and 8 to 10, get 62810, use the above method to obtain an integer with 2006 digits: 628101123 ......, Then the sum of the numbers of this integer is ().

(2006-5) Listen 10 = 200... 1

17 + 35 × 200 + 1 = 7018

The sum of the preceding 62810 digits is 17.

Start later, with "1123581347" as the cycle Section

A total of 10 cycles, each of which is 35

Add 1 to the last remaining 1.

Therefore, the result is 17 + 35*200 + 1 = 7018.

 

Example: PKU 1006

Because only three numbers 23 28 33 and three numbers are mutually prime numbers, we can see the "China Residue Theorem ".
For each group of input data P, E, I, D, the result is: N = (R1 * P + R2 * E + R3 * I) % 21252-d
R1 % P = 1, R2 % E = 1, R3 % I = 1;
R1 = 5544 = 28*33*6; // the smallest integer in the public multiple of 28 33 that can be divided by 23 in excess 1
R2 = 14221 = 23*33*19; // the smallest integer in the public multiple of 23 33 that can be divided by 28 in excess 1
R3 = 1288 = 23*28*2; // the smallest integer that can be divided by 33 in a public multiple of 23 28
To ensure that the result is greater than or equal to 1 and less than or equal to 21252, the result is corrected to: N = (R1 * P + R2 * E + R3 * I-d + 21252) % 21252, if n is 0, n = 21252 is required.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.