Repulsion principle, Euler function, phi

Source: Internet
Author: User

The principle of tolerance and repulsion:

Direct pick Baidu Entry:

    

Can also be expressed as set S as a finite set, then the A∪B formula for two sets: A+b-a∩b (∩: Coincident parts) Three sets of the tolerance formula: A∪b∪c = A+b+c-a∩b-b∩c-c∩a +a∩b∩c Detailed reasoning is as follows: 1, equation right modification = {[ (A+B-A∩B) +c-b∩c]-C∩a}+ A∩b∩c2, the Venturi block tag as shown on the right: 1245 constitutes a,2356 composition b,4567 constitute C3, the right of the equation refers to the 1+2+3+4+5+6 six part: Then A∪b∪c is missing Part 7. 4, the equation to the right [] number +c (4+5+6+7), the equivalent of A∪b∪c added 4+5+6 three parts, minus b∩c (that is, 5+6 two parts), but also add some 4. 5, the right side of the equation {} minus c∩a (that is, 4+5 two parts), A∪b∪c again minus Part 5, then add A∩b∩c (that is 5) is just a∪b∪c. Euler function definition The Euler function Phi (n) represents the number of positive integers (including 1) that are smaller than N and coprime with N. For example: PHI (1) = 1; PHI (2) = 1; PHI (3) = 2; PHI (4) = 2; ... PHI (9) = 6; ...

The general formula and its proof the Euler function to calculate a positive integer n is as follows:
1. Multiply n by the number of primes: n = p1 ^ K1 * p2 ^ k2 * ... * pn ^ kn (here p1, p2, ..., PN is prime) 2. PHI (n) =(p1 ^ k1-p1 ^ (k1-1))*(p2 ^ k2-p2 ^ (k2-1))* ... *(pn ^ KN-PN ^ (kn-1))
=n* (p1-1) (p2-1) ... (pi-1)/(P1*P2*......PI);
=n* (1-1/P1) * (1-1/P2) .... (1-1/PN) However, another method for solving the Euler Phi function value is given on purple potato (the method is very similar to the Sieve method for prime number).
voidPhi_table (intNint*Phi) {     for(intI=2; i<=n;i++) phi[i]=0; Phi[i]=1;  for(intI=2; i<=n;i++)if(!Phi[i]) {         for(intj=i;j<=n;j+=i) {if(!phi[j]) phi[j]=J; PHI[J]=phi[j]/i* (I-1); }    }}

However, I did not understand its principle =

Repulsion principle, Euler function, phi

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.