Dividers of a number n

124 Views Asked by At

If $n=p_1^{2a_1}p_2^{2a_2}...p_n^{2a_n}$

Number of divisors of $n$:

$(2a_1+1)(2a_2+1)...(2a_n+1)$

I saw an other similar question, but it is complicated. There should be an more easy answer.

2

There are 2 best solutions below

2
On BEST ANSWER

It's much more simple than that. For each divisor $d$ of $n$, $\frac nd$ is another divisor of $n$. So the divisors of $n$ come in pairs except if there is a divisor $d$ such that $d=\frac nd$. But this happens if and only if $n$ is a perfect square ($d=\frac nd\iff n=d^2$).

0
On

The thing to note is "complimentary" factors come in pairs.

If the number is $N$ and $a$ is a factor of $N$, then $\frac {N}a$ is also a factor of $N$.

And for any factor $a$ you can match it up with the factor $\frac {N}a$.

List all the factors in order $1<a_1< a_2<.......< a_m< N$. Each factor $a_i$ gets matched up with $a_{m-i} = \frac N{a_i}$.

If $a_i \ne a_{m-i}= \frac {N}{a_i}$ for all $i$ then there are an even number of factors.

If the very middle factor is $a_i = a_{m-i} = \frac N{a_i}$ then there is an odd number of factors.

If $a_i = a_{m-i} =\frac N{a_i}$ then $a_i^2 = N$ and $N$ is a perfect square.

And if $N$ is not a perfect square then that doesn't happen.