Number Theory Basics

Euler function

Is defined: [Phi] (x) with x 1 to x number of mutually interstitial number .

φ (x) = x * Π (p for all prime factors of x) (1-1 / p)

Briefly explain, in fact, it is the use of inclusion and exclusion. Let x be in multiples of two distinct prime factors p, q, x, p. 1 to have x / a p, q are multiples of x / q months, these after removing the number, we may remove some less than x repeating both p is a multiple of a multiple of the number q, which have added back time, so there are φ (x) = xx / px / q + x / p * q. about simplification can be obtained by φ (x) = x (1-1 / p-1 / q + 1 / p * q) = x (1-1 / p) (1-1 / q). Similarly for multi- a qualitative factor may be calculated using inclusion and exclusion, after the last equation is the simplified formulas given.

Euler's theorem

If a, p prime, then A [Phi] (P) ≡1 (mod p) .

Before prove to add some definitions about the nature of the mod.

Congruence class provided 0 <= a <m, ( a + k * m) on the congruence m, said set {a + k * m} is a congruence class modulo m.

The remaining lines completely  all congruence class set constituted of m becomes m based entirely remaining { 0 , . 1 , 2 , . 3 ... m. 1- }.

Simplify the remaining lines 1 to m in the set congruence class m coprime numbers representative configuration becomes simplified remaining lines, they have [Phi] (m) number. For example simplified 8 remaining lines is { 1 , 3 , 5 , 7 } .

Properties simplified remaining lines: modulo m multiplier is closed  if a and b and m are relatively prime, then a * b also m coprime, as a, b and m have no common prime factors, so a * b and m are also no common prime factors, seen from gcd (a * b, m) = gcd (m, a * b% m), a * b% m and m coprime also, thereby simplifying a * b m are the remaining lines .

prove:

Bi is set to 1 and p is prime to p i-th, consider a * bi≡a * bj (modp), a (bi-bj) ≡0 (modp), because with a prime p, so bi -bj = 0, bi = bj, that is, only when bi = bj a * bi≡a * bj (modp) can be established.

In summary, { B1 , B2 , B3 .... bφ (p) } remaining constituting a simplified system, with a prime p, and therefore belong to a simplified remaining lines, due to the simplified multiplication remainder based closed, and only when bi = BJ, only a * bi≡a * bj (modp) , and bi vary, so { A * B1 , A B2 * , A * B3 ... A * bφ (P) } is also configured simplify the remaining lines, so there is (a * b1) (a * b2) ... (a * bφ (p)) = b1 * b2 ... * bφ (p) (modp), bi and p are relatively prime, Simplification of what you can get A [phi] (the p-) ≡1 (mod p).

Fermat's Little Theorem

If p is a prime number, there is for any integer A p ≡a (mod p) .

prove:

Seen from the Euler's theorem if p is a prime number, φ (p) = p- 1, for all integers a, is not a multiple of p, i.e., with a prime p, there is a p. 1- ≡1 (mod p), and when p is a multiple of the time, a p ≡a (mod p) is clearly established.

Inverse

Definitions: For the integers a, if present, a * b≡1 (modp), b is called an inverse element on a modulo p.

Action: If a * b≡1 (modp), then b may be viewed as (1 / a)% p, to be performed when the row division modulo operation when, for example, (c / a)% p, c can be written as * b% p.

Seeking: When a prime p and by Euler's theorem known aφ (p) ≡1 (modp) , a * aφ (p) -1≡1 (modp), so on a inverse modulo p (a * ) = a [Phi] (p) -1 when, especially when p is a prime number, (a *) = a p-2 .

Guess you like

Origin www.cnblogs.com/VBEL/p/11421015.html