Loading [MathJax]/jax/output/HTML-CSS/jax.js

Thursday, 3 May 2018

Number of Divisors

I came across this formula for calculating the number of divisors of a given number:σ0(n)=ri=1(ai+1) where r is the number of distinct prime factors and ai are their coefficients. For example, σ0(24)=2i=1(ai+1)=(3+1)(1+1)=8where r = 2 because there are two distinct prime factors (2 and 3) with indices of 3 and 1 respectively.

There are indeed eight factors of 24:1,2,4,8,3,6,12,24 so this is a quick and easy way to calculate the number of factors based on prime factors of a number and the degrees to which each of them are raised. It's similar to the formula for calculating the number of ways in which a number can be written as the sum of two squares viz.:

The fundamental theorem on sums of two squares is:

Let n=2kpa11parrqb11qbss , where the pi are distinct primes with pi1(mod4) and the qi are distinct primes with qj3(mod4). Then n is the sum of two squares if and only if all the bj are even. In that case, the number of distinct solutions is 12(a1+1)(a2+1)(ar+1) where x is the ceiling function, the smallest integer greater than or equal to x.

Of course by this rule, 24 cannot be written as a sum of two squares because it has a 4k+3 factor (3), raised to an odd power (1). However, 25=52 has no 4k+3 factors and its 4k+1 factor (5) is raised to the 2nd power. This means that it can be written as the sum of two squares in two distinct ways because 12(2+1)=2. The two ways are 52+02 and 42+32.

Getting back to the number of divisors however, the formula quoted is actually part of a more general formula (as explained in Wikipedia):

The divisor function is multiplicative, but not completely multiplicative.  The consequence of this is that, if we write n=ri=1paii where r=ω(n) is the number of distinct prime factors of n, pi is the ith prime factor, and ai is the maximum power of pi by which n is divisible, then we have σx(n)=ri=1p(ai+1)xi1pxi1 which is equivalent to the useful formula:σx(n)=ri=1aij=0pjxi=ri=1(1+pxi+p2xi++paixi). It follows (by setting x=0) that d(n) is: σ0(n)=ri=1(ai+1).

No comments:

Post a Comment