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