1

Suppose there are $m$ prime numbers. I need to choose $n$ numbers from these $m$ numbers, and each number can be used for multiple times, then how many possible products of the chosen $n$ numbers?

My thought is that letting $E(i,j)$ to denote choosing $i$ numbers from $j$ different numbers, then I can derive that $$E(i+1,j)=E(i,1)+E(i,2)+ ... + E(i,m)=\sum_{t=1}^m E(i,t)$$.

But it's hard for me to derive an explicit expression for $E(n,m)$. Can someone help me?

  • It depends on whether the numbers could include $\pm 1$. If not, then every choice should yield a unique product (assuming you mean pairwise relatively prime). – Erick Wong Aug 25 '16 at 05:06
  • Yes, indeed, each choice can yield a unique product (I've changed my problem description, thx). I just couldn't figure out how many number of possible choices. – Steve Yang Aug 25 '16 at 05:14
  • In that case this is a very well-known elementary counting problem. See http://math.stackexchange.com/questions/139395/number-of-ways-of-choosing-m-objects-with-replacement-from-n-objects. It's fairly easy to guess the general formula if you work out the special cases $n=1,2,3$, and once guessed it can be proven by straightforward induction (of course the combinatorial argument is more elegant but perhaps less obvious to come up with). – Erick Wong Aug 25 '16 at 05:17

1 Answers1

0

Let $a_i$ denote the appearances of the $i$-th number. Then $a_1+\cdots+a_m=n$ with $a_i\ge0$.

Modify it a bit: $b_i=a_i+1$ (This makes the solution easier). Then $b_1+\cdots+b_m = m+n$, with $b_i\ge 1$.

Think of it this way. There are $m+n$ balls placed in a line, and you want to divide it into $m$ NONEMPTY pieces. You need to put $m-1$ boards in between the balls to make $m$ pieces. There are $n+m-1$ places where you can place the boards. Thus the answer is $\binom{n+m-1}{m-1}$.

Example: Six balls, two boards.

。。。|。。|。

loopy
  • 179