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.

Showing 1-8 of 8 results.

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

A063260 Sextinomial (also called hexanomial) coefficient array.

Original entry on oeis.org

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, 1, 5, 15, 35, 70, 126, 205, 305, 420, 540, 651, 735, 780
Offset: 0

Views

Author

Wolfdieter Lang, Jul 24 2001

Keywords

Comments

The sequence of step width of this staircase array is [1,5,5,...], hence the degree sequence for the row polynomials is [0,5,10,15,...]=A008587.
The column sequences (without leading zeros) are for k=0..5 those of the lower triangular array A007318 (Pascal) and for k=6..9: A062989, A063262-4. Row sums give A000400 (powers of 6). Central coefficients give A063419; see also A018901.
This can be used to calculate the number of occurrences of a given roll of n six-sided dice, where k is the index: k=0 being the lowest possible roll (i.e., n) and n*6 being the highest roll.

Examples

			The irregular table T(n, k) begins:
n\k 0 1 2  3  4  5  6  7  8  9 10 11 12 13 14 15
1:  1
2:  1 1 1  1  1  1
3:  1 2 3  4  5  6  5  4  3  2  1
4:  1 3 6 10 15 21 25 27 27 25 21 15 10  6  3  1
...reformatted - _Wolfdieter Lang_, Oct 31 2015
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, pp. 77,78.

Crossrefs

The q-nomial arrays for q=2..5 are: A007318 (Pascal), A027907, A008287, A035343 and for q=7: A063265, A171890, A213652, A213651.
Columns for k=0..9 (with some shifts) are: A000012, A000027, A000217, A000292, A000332, A000389, A062989, A063262, A063263, A063264.

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 6-nomials as a table
    r := 6:  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 + x^5)^n, x], {n, 0, 25}]] (* T. D. Noe, Apr 04 2011 *)
  • PARI
    concat(vector(5,k,Vec(sum(j=0,5,x^j)^k)))  \\ M. F. Hasler, Jun 17 2012

Formula

G.f. for row n: (Sum_{j=0..5} x^j)^n.
G.f. for column k: (x^(ceiling(k/5)))*N6(k, x)/(1-x)^(k+1) with the row polynomials from the staircase array A063261(k, m) and with N6(6,x) = 5 - 10*x + 10*x^2 - 5*x^3 + x^4.
T(n, k) = 0 if n=-1 or k<0 or k >= 5*n + 1; T(0, 0)=1; T(n, k) = Sum_{j=0..5} T(n-1, k-j) else.
T(n, k) = Sum_{i = 0..floor(k/6)} (-1)^i*binomial(n,i)*binomial(n+k-1-6*i,n-1) for n >= 0 and 0 <= k <= 5*n. - Peter Bala, Sep 07 2013
T(n, k) = Sum_{i = max(0,ceiling((k-2*n)/3)).. min(n,k/3)} binomial(n,i)*trinomial(n,k-3*i) for n >= 0 and 0 <= k <= 5*n. - Matthew Monaghan, Sep 30 2015

Extensions

More terms and corrected recurrence from Nicholas M. Makin (NickDMax(AT)yahoo.com), Sep 13 2002

A171890 Octonomial coefficient array.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 1, 3, 6, 10, 15, 21, 28, 36, 42, 46, 48, 48, 46, 42, 36, 28, 21, 15, 10, 6, 3, 1, 1, 4, 10, 20, 35, 56, 84, 120, 161, 204, 246, 284, 315, 336, 344, 336, 315, 284, 246, 204, 161, 120, 84, 56, 35
Offset: 0

Views

Author

N. J. A. Sloane, Oct 19 2010

Keywords

Comments

Row lengths are 1,8,15,22,... = 1+7n = A016993(n). Row sums are 1,8,64,... = 8^n = A001018(n). M. F. Hasler, Jun 17 2012

Examples

			Array begins:
[1]
[1, 1, 1, 1, 1, 1, 1, 1]
[1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1]
...
		

Crossrefs

The q-nomial arrays are for q=2..10: A007318 (Pascal), A027907, A008287,A035343, A063260, A063265, A171890, A213652, A213651.

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 8-nomials as a table
    r := 8:  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 + x^5 + x^6 + x^7)^n, x], {n, 0, 10}]] (* T. D. Noe, Apr 04 2011 *)
  • PARI
    concat(vector(5, k, Vec(sum(j=0, 7, x^j)^k)))  \\ M. F. Hasler, Jun 17 2012

Formula

Row n has g.f. (1+x+...+x^7)^n.
T(n,k) = sum {i = 0..floor(k/8)} (-1)^i*binomial(n,i)*binomial(n+k-1-8*i,n-1) for n >= 0 and 0 <= k <= 7*n. - Peter Bala, Sep 07 2013

A025015 Central decanomial coefficients: largest coefficient of (1 + x + ... + x^9)^n.

Original entry on oeis.org

1, 1, 10, 75, 670, 6000, 55252, 512365, 4816030, 45433800, 432457640, 4123838279, 39581170420, 380242296850, 3671331273480, 35460394945125, 343900019857310, 3335361909606710, 32458256583753952, 315825118347405835
Offset: 0

Views

Author

Keywords

Comments

Number of integers in [0, 10^n-1] whose sums of digits are equal to the most common value, which is 9*n/2 for even n and (9*n +/- 1)/2 for odd n > 1. E.g., the most common value of sums of digits of numbers from 0 to 9999 is 9*4/2 = 18, so there are a(4)=670 numbers in this range whose sums of digits are 18. - Warut Roonguthai, Jun 08 2006
Generally, largest coefficient of (1 + x + ... + x^k)^n is asymptotic to (k+1)^n * sqrt(6/(k*(k+2)*Pi*n)). - Vaclav Kotesovec, Aug 09 2013
a(n) is the largest coefficients of the n-th row of A213651. - Miquel Cerda, Jul 19 2017

Crossrefs

Row 10 of A077042.

Programs

  • Mathematica
    Flatten[{1,Table[Coefficient[Expand[Sum[x^j,{j,0,9}]^n],x^Floor[9*n/2]],{n,1,20}]}] (* Vaclav Kotesovec, Aug 09 2013 *)

Formula

a(n) = Sum_{k=0..floor(9*n/20)}(-1)^(k)*binomial(n, k)*binomial(n+floor(9*n/2)-10*k-1, n-1). - Warut Roonguthai, Jun 08 2006
a(n) ~ 10^n * sqrt(2/(33*Pi*n)). - Vaclav Kotesovec, Aug 09 2013

A071976 Number of lists of length n from {0..9} summing to n but not beginning with 0.

Original entry on oeis.org

1, 2, 6, 20, 70, 252, 924, 3432, 12870, 48619, 184735, 705222, 2702609, 10390940, 40062132, 154830696, 599641425, 2326640877, 9042327525, 35194002709, 137160956815, 535193552973, 2090558951396, 8174176541450, 31990402045260, 125301956523471, 491168514123342
Offset: 1

Views

Author

Amarnath Murthy, Jun 18 2002

Keywords

Comments

Number of n-digit numbers with digit sum n.
Middle diagonal of A213651. - Miquel Cerda, Aug 11 2017

Examples

			a(3) = 6 as there are six three-digit numbers with digit sum 3: 102, 111, 120, 201, 210, 300.
a(10) = binomial(18,9)-1; a(11) = binomial(20,10)-21; a(12) = binomial(22,11)-210.
		

Crossrefs

Different from A000984.
Number of n-digit entries in A061384.

Programs

  • Maple
    T:= add(x^i,i=0..9):
    seq(coeff(T^n - T^(n-1),x,n), n=1..25); # Robert Israel, Apr 06 2016
  • Mathematica
    Do[c = 0; k = 10^n; l = 10^(n + 1) - 1; While[k < l, If[ Plus @@ IntegerDigits[k] == n + 1, c++ ]; k++ ]; Print[c], {n, 0, 7}]
  • PARI
    a(n)=local(y=(x^10-1)/(x-1)); if(n<1,0,polcoeff((y-1)*y^(n-1),n))

Formula

Equals binomial(2n-2, n-1) for n <= 9, by the stars and bars argument. [To get such a number take n boxes in which the leftmost box contains a 1 and the rest are empty. Distribute the remaining n-1 1's into the n boxes subject to the constraint that no box contains more than 9 1's. This can be done in binomial(2n-2, n-1) ways for n <= 9.]
Coefficient of x^n in T^n - T^(n-1), where T = 1+x+...+x^9. - Robert Israel, Apr 06 2016

Extensions

Edited by N. J. A. Sloane and Robert G. Wilson v, Jun 20 2002
More terms from Vladeta Jovovic, Jun 21 2002
More terms from John W. Layman, Jun 22 2002

A213652 9-nomial coefficient array: Coefficients of the polynomial (1+...+X^8)^n, n=0,1,...

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 3, 6, 10, 15, 21, 28, 36, 45, 52, 57, 60, 61, 60, 57, 52, 45, 36, 28, 21, 15, 10, 6, 3, 1, 1, 4, 10, 20, 35, 56, 84, 120, 165, 216, 270, 324, 375, 420, 456, 480, 489, 480, 456
Offset: 0

Views

Author

M. F. Hasler, Jun 17 2012

Keywords

Comments

The n-th row also yields the number of ways to get a total of n, n+1,..., 9n, when summing n integers ranging from 1 to 9.
The row sums equal 9^n = A001019(n).
The row lengths are 1+8n = A017077(n).

Examples

			The triangle starts:
(row n=0) 1; (row sum = 1, row length = 1)
(row n=1) 1,1,1,1,1,1,1,1,1; (row sum = 9, row length = 9)
(row n=2) 1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1; (sum = 81, length = 17)
(row n=3) 1,3,6,10,15,21,28,36,45,52,57,60,61,60,... (sum = 729, length = 25)
(row n=4) 1, 4, 10, 20, 35, 56, 84, 120, 165, 216, 270, 324, 375, 420, 456,... (sum = 9^4; length = 33),
etc.
		

Crossrefs

The q-nomial arrays are for q=2..10: A007318 (Pascal), A027907, A008287, A035343, A063260, A063265, A171890, A213652, A213651.

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 9-nomials as a table
    r := 9:  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
  • PARI
    concat(vector(5,k,Vec(sum(j=0,8,x^j)^(k-1))))

Formula

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

A273975 Three-dimensional array written by antidiagonals in k,n: T(k,n,h) with k >= 1, n >= 0, 0 <= h <= n*(k-1) is the coefficient of x^h in the polynomial (1 + x + ... + x^(k-1))^n = ((x^k-1)/(x-1))^n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 3, 2, 1, 1, 3, 6, 7, 6, 3, 1, 1, 4, 6, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 3, 6, 10, 12, 12, 10, 6, 3, 1, 1, 4, 10
Offset: 1

Views

Author

Andrey Zabolotskiy, Nov 10 2016

Keywords

Comments

Equivalently, T(k,n,h) is the number of ordered sets of n nonnegative integers < k with the sum equal to h.
From Juan Pablo Herrera P., Nov 21 2016: (Start)
T(k,n,h) is the number of possible ways of randomly selecting h cards from k-1 sets, each with n different playing cards. It is also the number of lattice paths from (0,0) to (n,h) using steps (1,0), (1,1), (1,2), ..., (1,k-1).
Shallow diagonal sums of each triangle with fixed k give the k-bonacci numbers. (End)
T(k,n,h) is the number of n-dimensional grid points of a k X k X ... X k grid, which are lying in the (n-1)-dimensional hyperplane which is at an L1 distance of h from one of the grid's corners, and normal to the corresponding main diagonal of the grid. - Eitan Y. Levine, Apr 23 2023

Examples

			For first few k and for first few n, the rows with h = 0..n*(k-1) are given:
k=1:  1;  1;  1;  1;  1; ...
k=2:  1;  1, 1;  1, 2, 1;  1, 3, 3, 1;  1, 4, 6, 4, 1; ...
k=3:  1;  1, 1, 1;  1, 2, 3, 2, 1;  1, 3, 6, 7, 6, 3, 1; ...
k=4:  1;  1, 1, 1, 1;  1, 2, 3, 4, 3, 2, 1; ...
For example, (1 + x + x^2)^3 = 1 + 3*x + 6*x^2 + 7*x^3 + 6*x^4 + 3*x^5 + x^6, hence T(3,3,2) = T(3,3,4) = 6.
From _Eitan Y. Levine_, Apr 23 2023: (Start)
Example for the repeated cumulative sum formula, for (k,n)=(3,3) (each line is the cumulative sum of the previous line, and the first line is the padded, alternating 3rd row from Pascal's triangle):
  1  0  0 -3  0  0  3  0  0 -1
  1  1  1 -2 -2 -2  1  1  1
  1  2  3  1 -1 -3 -2 -1
  1  3  6  7  6  3  1
which is T(3,3,h). (End)
		

Crossrefs

k-nomial arrays for fixed k=1..10: A000012, A007318, A027907, A008287, A035343, A063260, A063265, A171890, A213652, A213651.
Arrays for fixed n=0..6: A000012, A000012, A004737, A109439, A277949, A277950, A277951.
Central n-nomial coefficients for n=1..9, i.e., sequences with h=floor(n*(k-1)/2) and fixed n: A000012, A000984 (A001405), A002426, A005721 (A005190), A005191, A063419 (A018901), A025012, (A025013), A025014, A174061 (A025015), A201549, (A225779), A201550. Arrays: A201552, A077042, see also cfs. therein.
Triangle n=k-1: A181567. Triangle n=k: A163181.

Programs

  • Mathematica
    a = Table[CoefficientList[Sum[x^(h-1),{h,k}]^n,x],{k,10},{n,0,9}];
    Flatten@Table[a[[s-n,n+1]],{s,10},{n,0,s-1}]
    (* alternate program *)
    row[k_, n_] := Nest[Accumulate,Upsample[Table[((-1)^j)*Binomial[n,j],{j,0,n}],k],n][[;;n*(k-1)+1]] (* Eitan Y. Levine, Apr 23 2023 *)

Formula

T(k,n,h) = Sum_{i = 0..floor(h/k)} (-1)^i*binomial(n,i)*binomial(n+h-1-k*i,n-1). [Corrected by Eitan Y. Levine, Apr 23 2023]
From Eitan Y. Levine, Apr 23 2023: (Start)
(T(k,n,h))_{h=0..n*(k-1)} = f(f(...f(g(P))...)), where:
(x_i)_{i=0..m} denotes a tuple (in particular, the LHS contains the values for 0 <= h <= n*(k-1)),
f repeats n times,
f((x_i){i=0..m}) = (Sum{j=0..i} x_j)_{i=0..m} is the cumulative sum function,
g((x_i){i=0..m}) = (x(i/k) if k|i, otherwise 0)_{i=0..m*k} is adding k-1 zeros between adjacent elements,
and P=((-1)^i*binomial(n,i))_{i=0..n} is the n-th row of Pascal's triangle, with alternating signs. (End)
From Eitan Y. Levine, Jul 27 2023: (Start)
Recurrence relations, the first follows from the sequence's defining polynomial as mentioned in the Smarandache link:
T(k,n+1,h) = Sum_{i = 0..s-1} T(k,n,h-i)
T(k+1,n,h) = Sum_{i = 0..n} binomial(n,i)*T(k,n-i,h-i*k) (End)

A276643 Number of distinct 4-digit vehicle plates whose sum is n.

Original entry on oeis.org

1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 282, 348, 415, 480, 540, 592, 633, 660, 670, 660, 633, 592, 540, 480, 415, 348, 282, 220, 165, 120, 84, 56, 35, 20, 10, 4, 1
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of weak compositions (ordered partitions) into four parts 0, 1, 2, ..., 9. - Joerg Arndt, May 02 2017
The 4th row of A213651. - Omar E. Pol, May 02 2017
a(n) is the number of integers in the range 0 to 9999 whose sum of digits = n. There are 10000 numbers in the range 0 to 9999 and in this sequence they are distributed according to the sum of their digits (n). - Miquel Cerda, Jun 14 2017

Examples

			a(0) = 1 because 0000 is the only plate which sums to 0.
a(1) = 4 because there are 4 plates which sum to 1: 0001, 0010, 0100 and 1000.
a(2) = 10 because there are 10 numbers whose digits sum to 2: 2, 11, 20, 101, 110, 200, 1001, 1010, 1100, 2000. - _Miquel Cerda_, Jun 14 2017
		

Crossrefs

Cf. A213651.

Programs

  • Mathematica
    Length /@ Split@ Sort@ Map[Total, IntegerDigits@ Range[0, 10^4 - 1]] (* Michael De Vlieger, May 03 2017 *)
  • PARI
    { my(x='x+O('x^44)); Vec(sum(k=0,9,x^k)^4) } \\ Joerg Arndt, May 02 2017
  • R
    library(dplyr)
    data=expand.grid(0:9, 0:9, 0:9, 0:9, KEEP.OUT.ATTRS = FALSE)
    data %>%
      mutate(n=Var1+Var2+Var3+Var4) %>%
      group_by(n) %>%
      summarise(value=n()) -> suc
    View(suc)
    
Showing 1-8 of 8 results.