Positive integer values for volume of a box

92 Views Asked by At

does anyone have a suggestion for an algorithm for the number of positive integer values for the sides of a box with a given Volume? So the diophantine equation lwh=V, where V is given. So for V=1 there are three different solutions (1,1,3 & 1,3,1 & 3,1,1).I'd like to be able to tell how many solutions there are for a given V.

1

There are 1 best solutions below

0
On BEST ANSWER

Let $$ V=\prod_{p_i\in\mathbb{P}} p_i^{s_i} $$ the prime factorization of $V$. There are $$ \binom{s_i+3-1}{3-1} $$ possible ways of distributing the powers of $p_i$ across the factors $l$, $w$ and $h$. Therefore the overall number of solutions is $$ \prod_i \binom{s_i +2}{2} $$