Respuesta :

Let nn be any positive integer, and let d(n)d(n) denote the number of positive divisors of nn. Positive divisors of nn appear in pairs {a,na}{a,na}. Pairs of divisors aanana are distinct except when n=a2n=a2. So if nn is not a perfect square, d(n)d(n) is even. If nn is a perfect square, then d(n)d(n) is odd. In other words,

d(n)d(n) is odd if and only if nn is a perfect square.

Determining one of aanana fixes the other ‘‘‘‘complimentary”” divisor. Therefore the number of ways in which we can write n=a⋅b=a⋅nan=a⋅b=a⋅na is the number of ways in which we can choose aa.

If nn is not a perfect square, the number of such choices equals 12d(n)12d(n).

If nn is a perfect square, the number of such choices equals 12(d(n)−1)12(d(n)−1). We may combine the two cases by the expression

d(n)2d(n)2.