The only decomposition theorem (arithmetic basic theorem) and its application

Source: Internet
Author: User

arithmetic basic theorem : any one natural number greater than 1 N, if n is not prime , then n can be uniquely decomposed into the product of finite prime numbers

N = p1^a1 * P2^A2 * p3^a3 * ... * pn^an

(Wherein P1, p2 、... pn is n factor, A1, A2 、... 、 an exponent of the factor respectively)

Such decomposition is called the standard decomposition of N

Application:

(1) A positive integer greater than 1 N, if its standard decomposition is:

N = p1^a1 * P2^A2 * p3^a3 * ... * pn^an

(2) N the number of factors M (n) = (1 + A1) * (1 + A2) * (1 + A3) *...* (1 + an);

(3) The sum of all its positive factors is

A (N) = (1 + p1 + p1^2 + p1^3 + ... + p1^n) * (1 + p2 + p2^2 +p2^3 +... +p2^n) * ...* (1 + pn + pn^2 + pn^3 + ... + pn^n); if a (n) = 2N, then N is called the complete number
intFac[n][n], J;//Fac[i][0] Indicates what the first factor is, fac[i][1] represents the number of the factor I (i.e. the exponent of the factor in the unique decomposition theorem)voidFactintN) {J=0;//j = Number of factors for nmemset (FAC,0,sizeof(FAC));  for(inti =2; I <= N; i++)    {        if(n% i = =0) {fac[j][0] =i;  while(n% i = =0) {n/=i; fac[j][1]++; } J++; }    }    if(N >1) {fac[j][0] =N; fac[j][1] =1; }}//find the N decomposition factor, and the exponent of its factor

The only decomposition theorem (arithmetic basic theorem) and its application

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.