3

The number of solutions of the equation $a+2b=k$ is $\left\lfloor\frac{k}{2}\right\rfloor+1,$ where $a,b\in \mathbb{N}\cup\{0\}\mbox{ and fixed }k\in\mathbb{N}.$ More general what is the number of solutions of the equation $a_{1}+2a_{2}+3a_{3}+\ldots+(r-1)a_{r-1}+ra_{r}=k,$ where $a_{i}\in\mathbb{N}\cup\{0\}\quad 1\leq i\leq r \mbox{ and fixed }k\in\mathbb{N}?$

2 Answers2

3

The number of solutions of $\sum_{i=1}^r ia_i=k$ in the nonnegative integers is equal to the number of integer partitions of $k$ whose parts all have size at most $r$. The numbers $a_i$ represent the number of parts of size $i$.

The number of such partitions is sometimes denoted $p_{\le r}(k)$. There is no closed form for this $p_{\le r}(k)$. It can be shown using Schur's theorem that asymptotically, $$ p_{\le r}(k)\sim \frac{k^{r-1}}{r!(r-1)!}\qquad \text{as }{k\to\infty}. $$

Mike Earnest
  • 75,930
1

An attempt may be recursive combinatorics. Let's call $S_{n,k}$ the number of solutions of:

$$\sum_{i=1}^{n} i \ a_i=k$$

Notice that if $a_n=0$, the problem reduces to $S_{n-1,k}$, if $a_n=1$ it reduces to $S_{n-1,k-n}$, and in general if $a_n=j$, it reduces to $S_{n-1,k-nj}$. Clearly :

$$k-nj>0 \Rightarrow j\leq \lfloor\frac kn\rfloor $$

So in general:

$$S_{n,k}=\sum_{j=0}^{\lfloor \frac kn\rfloor} S_{n-1,k-jn}$$

For example:

$$S_{3,90}=\sum_{j=0}^{30} S_{2,90-3j}$$

For your formula we know that:

$$S_{3,90}=\sum_{j=0}^{30}\lfloor \frac{90-3j}{2}\rfloor+1=31+\sum_{j=0}^{30}\lfloor \frac{90-3j}{2}\rfloor=31+690=721$$

:)

Kandinskij
  • 3,709