1

How many "$m$" digit numbers can be formed whose digits sum to "$N$"?

  • The collection of these numbers can have preceding zeros .
  • The collection of these numbers cannot duplicate multiplicity of digits except when the digit is zero.

e.g. when $m = 5$ and $N = 5$

  • If $00023$ is chosen, then $00041$ is legal for another choice.

  • If $00023$ is chosen, then $00203$ is not legal for another choice.

I appreciate any insight into solving this problem. Thanks in advance:)


Edit:

I was told that my question is better posed if I call what I called "numbers" above, functions of the form:

$$f:\quad \{0,1,\ldots,9\}\to{\mathbb N}_{\geq0}$$ ("multisets") satisfying $\sum_{k=0}^9 k f(k)=N$.


Edit $2:$

I'm realizing now that my original question is very general and opens up another dimension of difficulty.

Therefore, I propose specifying this problem such that $$N=m$$ AND $$f:\quad \{0,1,\ldots,k\}\to{\mathbb N}_{\geq0}$$ $$k\quad \epsilon \quad {\mathbb N}_{\geq0}$$

The motivation for this question is to evaluate the number of passive electrical component combinations that use each of $m$ elements in each combination as $N$ grows.

  • each component is of like value and type
  • each combination is restricted to be a series connection of parallel combinations.

The function $f$ , introduced above, has values at each $f(k)$ that represent the number of parallel elements in the $k^{th}$ link in the series connection.

Roby5
  • 4,287
  • You say 00023 is legal, then you say it is not. Why is 00203 not legal? Nothing you say seems to prohibit it. Please get the question right. – Ross Millikan Mar 02 '16 at 15:20
  • @RossMillikan I think the OP means to say that if you have counted 00023, then you cannot also count 00203 – shardulc Mar 02 '16 at 15:21
  • Yes. Shardulc is correct. I'll make that more clear – pickledpickles Mar 02 '16 at 15:24
  • Are you just saying that order is irrelevant? so $23$ is the same as $32$? As others are saying, the comment about "multiplicity" is not at all clear. – lulu Mar 02 '16 at 15:26
  • Yes, order is irrelevant. – pickledpickles Mar 02 '16 at 15:26
  • 3
    You are not counting decimal numbers satisfying certain conditions but functions $$f:\quad {0,1,\ldots,9}\to{\mathbb N}{\geq0}$$ ("multisets") satisfying $\sum{k=0}^9 k f(k)=N$. – Christian Blatter Mar 02 '16 at 16:23
  • I apologize if I did not word the prompt properly. If it is confusing, I can edit it, but I'll need help. I wrote the prompt in the most tractable way I know how. – pickledpickles Mar 02 '16 at 19:06
  • I've posted an edit to correct for the problem found by Christian Blatter. – pickledpickles Mar 02 '16 at 19:14
  • so if 00023 is chosen then you say 00203 isn't legal anymore? Did you mean by that, that then any number containing only 2,3 and zeros(or no zeros) isn't legal anymore? So you are basically searching for how many combinations of m digits is there to sum up to N, right? – Vepir Mar 03 '16 at 07:30
  • 1
    Is this problem means how many ways to split N into less than m part with each part less than 9? – Harry Mar 03 '16 at 08:24
  • Matta: yes , Harry: yes, that is the goal. – pickledpickles Mar 03 '16 at 14:37

1 Answers1

0

It actually seems that you are searching for a number of partitions of number $N$ using only digits form $1$ to $9$ (and including $0$s) and that have a limited top length of $m$!

Since partitions cannot be easily directly calculated, instead they are usually computed.

I believe this can be computed in GAP using RestrictedPartitions(N,[0..9],m);

Here are some of the solutions I have found for your $N$ sum and $m$ digits:

$$ \begin{array}{c|c} & m & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline N & & \\ \hline 1 & & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & \\ \hline 2 & & 1 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & \\ \hline 3 & & 1 & 2 & 3 & 3 & 3 & 3 & 3 & 3 & 3 & 3 & \\ \hline 4 & & 1 & 3 & 4 & 5 & 5 & 5 & 5 & 5 & 5 & 5 & \\ \hline 5 & & 1 & 3 & 5 & 6 & 7 & 7 & 7 & 7 & 7 & 7 & \\ \hline 6 & & 1 & 4 & 7 & 9 & 10 & 11 & 11 & 11 & 11 & 11 & \\ \hline 7 & & 1 & 4 & 8 & 11 & 13 & 14 & 15 & 15 & 15 & 15 & \\ \hline 8 & & 1 & 5 & 10 & 15 & 18 & 20 & 21 & 22 & 22 & 22 & \\ \hline 9 & & 1 & 5 & 12 & 18 & 23 & 26 & 28 & 29 & 30 & 30 & \\ \hline 10& & 0 & 5 & 13 & 22 & 29 & 34 & 37 & 39 & 40 & 41 & \\ \hline 11& & 0 & 4 & 14 & 25 & 35 & 42 & 47 & 50 & 52 & 53 & \\ \hline 12& & 0 & 4 & 15 & 30 & 43 & 54 & 61 & 66 & 69 & 71 & \\ \hline 13& & 0 & 3 & 15 & 32 & 50 & 64 & 75 & 82 & 87 & 90 & \\ \hline 14& & 0 & 3 & 15 & 36 & 58 & 78 & 93 & 104 & 111 & 116 & \\ \hline 15& & 0 & 2 & 15 & 38 & 66 & 91 & 112 & 127 & 138 & 145 & \\ \hline 16& & 0 & 2 & 14 & 41 & 74 & 107 & 134 & 156 & 171 & 182 & \\ \hline 17& & 0 & 1 & 13 & 41 & 81 & 121 & 157 & 185 & 207 & 222 & \\ \hline 18& & 0 & 1 & 12 & 43 & 88 & 139 & 184 & 222 & 251 & 273 & \\ \hline 19& & 0 & 0 & 10 & 41 & 93 & 152 & 210 & 258 & 297 & 326 & \\ \hline 20& & 0 & 0 & 8 & 41 & 98 & 169 & 239 & 302 & 352 & 392 & \\ \end{array} $$

Here is my Project I made and used to calculate the data in the table. Hope this was helpful to you.

Vepir
  • 12,516
  • Yes, this is great. Thank you. It should also allow me to extend the problem when each f(k) is not restricted to 9 , but all positive integers. I describe this extension more in the second edit to my original post. – pickledpickles Mar 05 '16 at 20:23
  • In particular, my most recent edit is looking at the main diagonal of this table, but it's interesting to see the rest – pickledpickles Mar 08 '16 at 14:48