cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A035343 Triangle of coefficients in expansion of (1 + x + x^2 + x^3 + x^4)^n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 3, 6, 10, 15, 18, 19, 18, 15, 10, 6, 3, 1, 1, 4, 10, 20, 35, 52, 68, 80, 85, 80, 68, 52, 35, 20, 10, 4, 1, 1, 5, 15, 35, 70, 121, 185, 255, 320, 365, 381, 365, 320, 255, 185, 121, 70, 35, 15, 5, 1, 1, 6, 21, 56, 126, 246, 426, 666
Offset: 0

Views

Author

Keywords

Comments

Coefficient of x^k in (1 + x + x^2 + x^3 + x^4)^n is the number of distinct ways in which k unlabeled objects can be distributed in n labeled urns allowing at most 4 objects to fall in each urn. - N-E. Fahssi, Mar 16 2008
The n-th row has 4n+1 terms (A016813). - Michel Marcus, Sep 08 2013
Number of lattice paths from (0,0) to (n,k) using steps (1,0), (1,1), (1,2), (1,3), (1,4). - Nicholas Ham, Sep 14 2018
T(n,k) is the number of ways to obtain a sum of n+k when throwing a 5-sided die n times. - Feryal Alayont, Dec 30 2024

Examples

			Triangle begins:
n\k [0]  [1]  [2]  [3]  [4]  [5]  [6]  [7]  [8]  [9]  [10] [11] [12]
[0] 1;
[1] 1,   1,   1,   1,   1;
[2] 1,   2,   3,   4,   5,   4,   3,   2,   1;
[3] 1,   3,   6,   10,  15,  18,  19,  18,  15,  10,  6,   3,   1;
[4] ...
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, pp. 77-78, 16. for q=5.
  • D. C. Fielder and C. O. Alford, Pascal's triangle: top gun or just one of the gang?, in G E Bergum et al., eds., Applications of Fibonacci Numbers Vol. 4 1991 pp. 77-90 (Kluwer).

Crossrefs

Programs

  • Maple
    #Define the r-nomial coefficients for r = 1, 2, 3, ...
    rnomial := (r,n,k) -> add((-1)^i*binomial(n,i)*binomial(n+k-1-r*i,n-1), i = 0..floor(k/r)):
    #Display the 5-nomials as a table
    r := 5:  rows := 10:
    for n from 0 to rows do
    seq(rnomial(r,n,k), k = 0..(r-1)*n)
    end do;
    # Peter Bala, Sep 07 2013
  • Mathematica
    Flatten[Table[CoefficientList[(1 + x + x^2 + x^3 + x^4)^n, x], {n, 0, 10}]] (* T. D. Noe, Apr 04 2011 *)
  • Maxima
    pentanomial(n,k):=coeff(expand((1+x+x^2+x^3+x^4)^n),x,k);
    create_list(pentanomial(n,k),n,0,6,k,0,4*n); /* Emanuele Munarini, Mar 15 2011 */
    
  • PARI
    row(n) = Vec(((1 + x + x^2 + x^3 + x^4)^n) + O(x^(4*n+1)))
    trianglerows(n) = for(k=0, n-1, print(row(k)))
    /* Print initial 5 rows of triangle as follows */
    trianglerows(5) \\ Felix Fröhlich, Aug 26 2018

Formula

T(n,k) = Sum_{i = 0..floor(k/5)} (-1)^i*binomial(n,i)*binomial(n+k-1-5*i,n-1) for n >= 0 and 0 <= k <= 4*n. - Peter Bala, Sep 07 2013