In how many ways can a number be written as a product of two different factors?


FOR EXAMPLE:Let the number be $8100$=$2^23^45^2$.

Number of divisors = $(2+1)(4+1)(2+1) = 45$

The divisors can be written as product of two numbers like.

$1 \times 8100$

$2 \times 4050$

$3 \times 2700$

$4 \times 2025$

$5 \times 1620$




$8100 \times 1$

Due to repetition a top-bottom symmetry can be observed.Hence the actual number of ways of representing as a product should be


Is my approach correct?Can someone please verify whether my argument that the final answer should be $\frac{45+1}{2}$ is valid?

EDIT:As @mathlove pointed out we need to subtract 1 as $90*90$ is not allowed as the question asks for different factors.Final result $\frac{45-1}{2}=22$.

  • 1
    $\begingroup$ I think you want to subtract 1 from 45 instead of adding 1, since $2\cdot3^2\cdot5$ gets paired with itself. $\endgroup$
    – user84413
    Sep 17, 2016 at 16:44
  • $\begingroup$ @user84413 No I thought that there will be a central point about which there is a top-bottom symmetry.Something like 1 2 3 2 1.So the answer in this case should be $(5+1)/2$.Could you please elaborate where you think I'm going wrong? $\endgroup$
    – user220382
    Sep 17, 2016 at 16:46
  • $\begingroup$ Your approach is fine, just note for non-perfect squares the number you get when you add $1$ will be odd... $\endgroup$
    – Steve D
    Sep 17, 2016 at 16:52
  • 1
    $\begingroup$ @user84413 is talking about the word "different" in your question $\endgroup$
    – Steve D
    Sep 17, 2016 at 16:53
  • 2
    $\begingroup$ $(45+1)/2$ is wrong because it counts $90\times 90$. ("two different factors" in the title) $\endgroup$
    – mathlove
    Sep 17, 2016 at 17:08

2 Answers 2


You are almost right. As already observed in the comments, note that, calling $k_1, k_2, k_3... $ the exponents of each prime number in the factorization, if your final product $(k_1+1)(k_2+1)(k_3+1)... $ is odd, then this means that all exponents are even and so the number is a perfect square. In this case, to find the total nunber of ways to express the number as a product of two factors (regardless of whether these two factors are equal or different) you would have to add $ 1$ to your final product and divide to 2, since the symmetric distributions of the prime numbers in two factors $a \cdot b $ include one where $a=b $. For example, for $36= 2^2 \cdot 3^2$, we have $3 \cdot 3=9$ "total" divisors ($1, 2, 3, 4, 6, 9, 12, 18, 36$) but $5$ ways to express $36$ as a product of two factors ($36 \cdot 1, 18 \cdot 2, 12 \cdot 3, 9 \cdot 4, 6 \cdot 6$).
So if the question talks about two "different" factors, you have to subtract 1 and divide to 2 (in this example we have to exclude the product $6 \cdot 6$).

In contrast, if the final product is even, then the number is not a perfect square and so you only have to divide to 2.


Yes, you are globally correct.

  • Let $n \in N , n = \sum p_i^{w_i}$ , the prime decomposition of $n$.

  • For the 1st factor, by choosing all the combinations of the powers of the primes from $0$ to their effective values, we get the number of ways to write $n$ with two factors : $S_1 = \prod (w_i+1)$. The second number is merely unique , it is the quotient of $n$ by the 1st found.

  • Now, we want to count only the pairs of different factors $S_2$, let's check if $n$ is a square, or if all the $w_i$ are even. In this case, decrease the previous result by $1$

  • Finally, it we consider that each solution $(a,b)$ is the same than $(b,a)$, then $S_3 = \frac{S_2}2$. We can do it since we have removed the only possible same factor pair.


You must log in to answer this question.