# The function d(n)

#### 1337h4x

Hello everyone,

I have some questions about the function d(n) which gives the number of positive divisors of n including n itself.

1. How can it be proven that d(n) is odd IFF n is a perfect square? (Kind of like proving that d(n) is odd iff n = k^2 for some integer k.

2. How is the following statement true: The product of all of the positive divisors of n (including n itself) is n^[d(n)/2] . Is there a proof for this ?

Any help is appreciated!

Last edited:

#### Bruno J.

MHF Hall of Honor
Hello everyone,

I have some questions about the function d(n) which gives the number of positive divisors of n including n itself.

1. How can it be proven that d(n) IFF n is a perfect square? (Kind of like proving that d(n) is odd iff n = k^2 for some integer k.

2. How is the following statement true: The product of all of the positive divisors of n (including n itself) is n^[d(n)/2] . Is there a proof for this ?

Any help is appreciated!
1. That's not even a sentence! $$\displaystyle d(n)$$ what if and only if (...)?

2. Look at the power with which a prime dividing $$\displaystyle n$$ appears in the canonical factorization of the resulting product.

#### 1337h4x

1. That's not even a sentence! $$\displaystyle d(n)$$ what if and only if (...)?

2. Look at the power with which a prime dividing $$\displaystyle n$$ appears in the canonical factorization of the resulting product.
I fixed it, It should say d(n) is odd IFF ...

Anyways, what do you mean by your point of 2? Can you also explain my first question?

#### 1337h4x

Can anyone help with this? I'm struggling to understand this.

#### 1337h4x

Can anyone please explain the second question at least? I'm really stuck on this concept.

#### PaulRS

MHF Hall of Honor
For all parts, note that if $$\displaystyle d|n$$ then $$\displaystyle \left(\tfrac{n}{d}\right)|n$$, the idea would be the following:

For each divisor $$\displaystyle d<\sqrt{n}$$ there's a corresponding one $$\displaystyle \tfrac{n}{d}>\sqrt{n}$$, the only divisor that is not counted here is $$\displaystyle d = \tfrac{n}{d}=\sqrt{n}$$ in case of this being possible (that is, n is a square).

Thus if $$\displaystyle n$$ is not a square the divisors come in pairs, hence the number of divisors in that case is even, and in the case of n being a square it is odd (we add one).

For the second part use the above idea and note that $$\displaystyle d\cdot \left(\tfrac{n}{d}\right)=n$$ -and now try to use it to calculate the product of the divisors-

#### 1337h4x

For all parts, note that if $$\displaystyle d|n$$ then $$\displaystyle \left(\tfrac{n}{d}\right)|n$$, the idea would be the following:

For each divisor $$\displaystyle d<\sqrt{n}$$ there's a corresponding one $$\displaystyle \tfrac{n}{d}>\sqrt{n}$$, the only divisor that is not counted here is $$\displaystyle d = \tfrac{n}{d}=\sqrt{n}$$ in case of this being possible (that is, n is a square).

Thus if $$\displaystyle n$$ is not a square the divisors come in pairs, hence the number of divisors in that case is even, and in the case of n being a square it is odd (we add one).

For the second part use the above idea and note that $$\displaystyle d\cdot \left(\tfrac{n}{d}\right)=n$$ -and now try to use it to calculate the product of the divisors-

What happens if you calculate the product of the divisors? I can't get this to related to n^(d(n)/2)....

#### 1337h4x

Wait, my problem involved d(n), your solution never mentioned d(n) it mentioned d...

#### chiph588@

MHF Hall of Honor
Wait, my problem involved d(n), your solution never mentioned d(n) it mentioned d...
His solution is adequate but look at it like this: I'm going to assume $$\displaystyle n$$ is not square.

Your product $$\displaystyle =\prod_{d|n}d = \prod_{d|n, \; d<\sqrt{n}} d \left(\frac{n}{d}\right) = \prod_{d|n, \; d<\sqrt{n}} n = n^{d(n)/2}$$

#### NonCommAlg

MHF Hall of Honor
for 1) let $$\displaystyle n=\prod_{j=1}^k p_j^{r_j}$$ be the prime factorization of $$\displaystyle n$$. then $$\displaystyle d(n)=\prod_{j=1}^k (1+r_j).$$ clearly $$\displaystyle d(n)$$ is odd if and only if $$\displaystyle r_j$$ is even for all $$\displaystyle j,$$ i.e. $$\displaystyle n$$ is a perfect square.

for 2) let $$\displaystyle P=\prod_{d \mid n} d.$$ then we'll also have $$\displaystyle P = \prod_{d \mid n} \frac{n}{d}$$ and thus $$\displaystyle P^2 = \prod_{d \mid n} d \cdot \frac{n}{d} = \prod_{d \mid n} n = n^{d(n)}.$$

• BBAmp and Bruno J.