"Concrete Mathematics"--Number theory

Source: Internet
Author: User
Tags greatest common divisor

Starting from this article, we began to explore the "forest" of number theory.

Divisible:

The problem of the division of numbers in number theory is nothing more than the approximate, multiple, approximate and multiple pairs of relative concepts, and if a is an approximate of B, then B is a multiple. We often use a|b to mean that B can divide a, that is, b/a is an integer, but "|" It is easy to confuse with absolute values, geometric definitions, conditional probabilities during use, so here we use a\b to denote that a can divide B.

Approximate: If b\a, it is said that B is an approximate of a.

Multiples: If b\a, then A is a multiple of B.

Greatest common divisor: gcd (A, b) = Max{k | K\a and k\b}.

Least common multiple: LCM (A, b) = min{k} k>0, a\k and B\k}

Let's explore the Euclidean algorithm for calculating gcd (A, B).

It is based on an important recursive--gcd (m,n) = gcd (n% m, m) and gcd (0,n) = N. (In fact, this recursive proof of the author in another article introduced.) )

Euclidean algorithm can also bring us more things, we generalize based on it, using it to solve the following equation of the solution (M ', n '):

M ' m + n ' n = gcd (m,n) ①

As can be seen, if M = 0, this equation obviously has countless groups of solutions.

If M! = 0, based on the Euclidean algorithm recursion, we take r = N m, you can convert ① equivalent, that is R ' r + M ' m = gcd (r,m) ②, you can see R = n (int) (n/m) m, we bring R into the ②, and do the following simplification operations.

R ' [n-(int) (n/m) m] + m ' m = gcd (r,m) = R ' n + [m '-R ' (int) (n/m)] = gcd (r,m) ③

It is easy to see that since gcd (r,m) = gcd (m,n), the equation ①③ is equivalent, so we will get the following equation:

n ' = R ' ④

M ' = M '-R ' (int) (n/m) ⑤

So for the ① solution we want to solve (m ', n '), we obviously need to know the solution of the ② (M ', R '), which forms a recursive solution pattern.

For the solution of the ① equation, many places in the field of number theory will be involved, here based on it there is also a simple inference: k\m, k\n is K\GCD (m,n) The sufficient and necessary conditions.

Prove that: adequacy, K is the male factor of M, N, obviously K is gcd (m,n) factor.

Necessity, K is the factor of gcd (M,n), obviously K is both the factor of M and the factor of N.

"Concrete Mathematics"--Number theory

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.