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.

A008287 Triangle of quadrinomial coefficients, row n is the sequence of coefficients of (1 + x + x^2 + x^3)^n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 3, 4, 3, 2, 1, 1, 3, 6, 10, 12, 12, 10, 6, 3, 1, 1, 4, 10, 20, 31, 40, 44, 40, 31, 20, 10, 4, 1, 1, 5, 15, 35, 65, 101, 135, 155, 155, 135, 101, 65, 35, 15, 5, 1, 1, 6, 21, 56, 120, 216, 336, 456, 546, 580, 546, 456, 336, 216, 120, 56, 21, 6, 1
Offset: 0

Views

Author

Keywords

Comments

Coefficient of x^k in (1 + x + x^2 + x^3)^n is the number of distinct ways in which k unlabeled objects can be distributed in n labeled urns allowing at most 3 objects to fall in each urn. - N-E. Fahssi, Mar 16 2008
Rows of A008287 mod 2 converted to decimal equals A177882. - Vladimir Shevelev, Jan 02 2011
T(n,k) is the number of compositions of k into n parts p, each part 0<=p<=3. Adding 1 to each part, as a corollary, T(n,k) is the number of compositions of n+k into n parts p where 1<=p<=4. E.g., T(2,3)=4 since 3=0+3=3+0=1+2=2+1. In general, the entry (n,k) of the (l+1)-nomial triangle gives the number of compositions of k into n parts p, each part 0<=p<=l. - Steffen Eger, Jun 18 2011
Number of lattice paths from (0,0) to (n,k) using steps (1,0), (1,1), (1,2), (1,3). - Joerg Arndt, Jul 05 2011
T(n-1,k-1) is the number of 3-compositions of n with zeros having k parts; see Hopkins & Ouvry reference. - Brian Hopkins, Aug 16 2020
T(n,k) is the number of ways to obtain a sum of n+k when throwing a 4-sided die n times. Follows from the "T(n,k) is the number of compositions of n+k into n parts p where 1 <= p <= 4" comment above. - Feryal Alayont, Dec 30 2024

Examples

			Triangle begins
  1;
  1,1,1,1;
  1,2,3,4,3,2,1;
  1,3,6,10,12,12,10,6,3,1; ...
		

References

  • Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 78.
  • 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

  • Haskell
    a008287 n = a008287_list !! n
    a008287_list = concat $ iterate ([1,1,1,1] *) [1]
    instance Num a => Num [a] where
       fromInteger k = [fromInteger k]
       (p:ps) + (q:qs) = p + q : ps + qs
       ps + qs         = ps ++ qs
       (p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs
        *                = []
    -- Reinhard Zumkeller, Apr 02 2011
  • 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 4-nomials as a table
    r := 4:  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
    # second Maple program:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))((1+x+x^2+x^3)^n):
    seq(T(n), n=0..10);  # Alois P. Heinz, Aug 17 2018
  • Mathematica
    Flatten[Table[CoefficientList[(1 + x + x^2 + x^3)^n, x], {n, 0, 10}]] (* T. D. Noe, Apr 04 2011 *)
    T[n_, k_] := Sum[Binomial[n, i] Binomial[n, k-2i], {i, 0, k/2}]; Table[T[n, k], {n, 0, 6}, {k, 0, 3n}] // Flatten (* Jean-François Alcover, Feb 02 2018 *)
  • Maxima
    quadrinomial(n,k):=coeff(expand((1+x+x^2+x^3)^n),x,k);
    create_list(quadrinomial(n,k),n,0,8,k,0,3*n); /* Emanuele Munarini, Mar 15 2011 */
    

Formula

n-th row is formed by expanding (1+x+x^2+x^3)^n.
From Vladimir Shevelev, Dec 15 2010: (Start)
T(n,0) = 1; T(n,3*n) = 1; T(n,k) = T(n,3*n-k);
T(n,k) = 0, iff k<0 or k>3*n; Sum{k=0..3*n} T(n,k) = 4^n; Sum{k=0..3*n}((-1)^k)*T(n,k)=0 for n > 0; [corrected by Werner Schulte, Sep 09 2015]
T(n,k) = Sum{i=0..floor(k/2)} C(n,i)*C(n,k-2*i);
T(n+1,k) = T(n,k-3)+T(n,k-2)+T(n,k-1)+T(n,k). (End)
T(n,k) = Sum_{i = 0..floor(k/4)} (-1)^i*C(n,i)*C(n+k-1-4*i,n-1) for n >= 0 and 0 <= k <= 3*n. - Peter Bala, Sep 07 2013
G.f.: 1/(1 - ( x + y*x + y^2*x +y^3*x )). - Geoffrey Critzer, Feb 05 2014
T(n,k) = Sum_{j=0..k} (-2)^j*binomial(n,j)*binomial(3*n-2*j,k-j) for n >= 0 and 0 <= k <= 3*n (conjectured). - Werner Schulte, Sep 09 2015