Pascal triangle with more numbers to add

344 Views Asked by At

I've found a way to make variants of Pascal's Triangle, by changing the number of values from the previous row to add up.

In this triangle I add three numbers.

             1
           1 1 1 
         1 2 3 2 1 
       1 3 6 7 6 3 1 
   1 4 10 16 19 16 10 4 1 
1 5 15 30 45 51 45 30 15 5 1

In this one I add six.

                                1 
                           1 1 1 1 1 1 
                      1 2 3 4 5 6 5 4 3 2 1 
            1 3 6 10 15 21 25 27 27 25 21 15 10 6 3 1 
1 4 10 20 35 56 80 104 125 140 146 140 125 104 80 56 35 20 10 4 1

Has this been studied before? Where can I find more information about it?

2

There are 2 best solutions below

0
On BEST ANSWER

Good news: this is a studied phenomenon! In fact, the fourth row in the 6-item grouping is one I know by heart from using it so often.

In general, we have this relationship:

$$x_m(r,c) = \begin{cases} 1&\text{if }r=c=0\\ 0&\text{if }r>c\times(m-1)\text{ or }c < 0\\ \sum_{k=c-m+1}^cx_m(r-1,k)&\text{otherwise} \end{cases}$$

This can be interpreted as the number of ways the sum of a set of $r$ $m$-sided dice that start at $0$ can add up to $c$.

There is also a generating function formula by rows that's really nice: $$\left(\frac{x^m-1}{x-1}\right)^r$$

The arrays for several of these exist in OEIS, indexed here by $m$: 2, 3, 4, 5, 6, 7, 8, 9, 10

0
On

From a computing point of view, you are applying a 1D convolution with a kernel of ones over an array of numbers padded with zeros in order to get each successive line. If I was programming this, I would start with a list containing 1, then pad it with n-1 zeros on either side and then perform a convolution operation containing kernel with n 1s over the array. This will give an array giving the next line. Then repeat the process again for the next line. I would have no idea about getting a formula for it though!