# Determining if n is a square from number of divisors?

• Aug 20th 2009, 06:01 PM
QM deFuturo
Determining if n is a square from number of divisors?
I've noticed for a few cases that if you compute all the divisors of a composite number, if this list of divisors (including 1 and the number) is even, then the number is not a square, and if it's odd, it is a square.

But that's just for some specific examples like

divisors of 30 : {1, 2, 3, 5, 6, 10, 15, 30 } : even # of divisors, and not a square

divisors of 36: {1, 2, 3, 4, 6, 9, 12, 18, 36}: odd # of divisors, and is a square.

I'm wondering is this just a coincidence, or does this hold for all numbers? And are there any correlations between number of divisors and if the number is a cube, a quadruple, etc?
• Aug 20th 2009, 06:10 PM
Bruno J.
Good eye! Your observation is correct. This is because, if $n=p_1^{\alpha_1}...p_m^{\alpha_m}$ then the number of divisors of $n$ is $(\alpha_1+1)...(\alpha_m+1)$. (Can you prove it?) In the case of a square all $\alpha$'s are even.

You can probably answer your other question with the help of the formula above.
• Aug 20th 2009, 08:48 PM
CaptainBlack
Quote:

Originally Posted by Bruno J.
Good eye! Your observation is correct. This is because, if $n=p_1^{\alpha_1}...p_m^{\alpha_m}$ then the number of divisors of $n$ is $(\alpha_1+1)...(\alpha_m+1)$. (Can you prove it?) In the case of a square all $\alpha$'s are odd.

You can probably answer your other question with the help of the formula above.

In the case of a square all $\alpha$'s are even.

CB
• Aug 21st 2009, 01:06 AM
TheAbstractionist
Quote:

Originally Posted by QM deFuturo
I've noticed for a few cases that if you compute all the divisors of a composite number, if this list of divisors (including 1 and the number) is even, then the number is not a square, and if it's odd, it is a square.

But that's just for some specific examples like

divisors of 30 : {1, 2, 3, 5, 6, 10, 15, 30 } : even # of divisors, and not a square

divisors of 36: {1, 2, 3, 4, 6, 9, 12, 18, 36}: odd # of divisors, and is a square.

I'm wondering is this just a coincidence, or does this hold for all numbers? And are there any correlations between number of divisors and if the number is a cube, a quadruple, etc?

Note that if $d$ is a divisor of $n$ then so is $\frac nd.$ Hence, all the divisors of $n$ occur in pairs $\left\{d,\,\frac nd\right\}.$ Furthermore $d=\frac nd\ \iff\ n=d^2$ is a perfect square. It folllows that if $n$ is not a perfect square, then it has an even number of divisors (since each pair of divisors $d,\,\frac nd$ will be distinct), while if $n$ is a perfect square then it has an odd number of divisors (the pairs $d,\,\frac nd$ are all distinct except for the divisor $d=\sqrt n\,).$
• Aug 21st 2009, 07:38 AM
Bruno J.
Quote:

Originally Posted by CaptainBlack
In the case of a square all $\alpha$'s are even.

CB

Haha. I can't believe I said that.
Obviously I meant "all the $\alpha+1$".