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-6 of 6 results.

A008299 Triangle T(n,k) of associated Stirling numbers of second kind, n >= 2, 1 <= k <= floor(n/2).

Original entry on oeis.org

1, 1, 1, 3, 1, 10, 1, 25, 15, 1, 56, 105, 1, 119, 490, 105, 1, 246, 1918, 1260, 1, 501, 6825, 9450, 945, 1, 1012, 22935, 56980, 17325, 1, 2035, 74316, 302995, 190575, 10395, 1, 4082, 235092, 1487200, 1636635, 270270, 1, 8177, 731731, 6914908, 12122110
Offset: 2

Views

Author

Keywords

Comments

T(n,k) is the number of set partitions of [n] into k blocks of size at least 2. Compare with A008277 (blocks of size at least 1) and A059022 (blocks of size at least 3). See also A200091. Reading the table by diagonals gives A134991. The row generating polynomials are the Mahler polynomials s_n(-x). See [Roman, 4.9]. - Peter Bala, Dec 04 2011
Row n gives coefficients of moments of Poisson distribution about the mean expressed as polynomials in lambda [Haight]. The coefficients of the moments about the origin are the Stirling numbers of the second kind, A008277. - N. J. A. Sloane, Jan 24 2020
Rows are of lengths 1,1,2,2,3,3,..., a pattern typical of matrices whose diagonals are rows of another lower triangular matrix--in this instance those of A134991. - Tom Copeland, May 01 2017
For a relation to decomposition of spin correlators see Table 2 of the Delfino and Vito paper. - Tom Copeland, Nov 11 2012

Examples

			There are 3 ways of partitioning a set N of cardinality 4 into 2 blocks each of cardinality at least 2, so T(4,2)=3.
Table begins:
  1;
  1;
  1,    3;
  1,   10;
  1,   25,     15;
  1,   56,    105;
  1,  119,    490,     105;
  1,  246,   1918,    1260;
  1,  501,   6825,    9450,      945;
  1, 1012,  22935,   56980,    17325;
  1, 2035,  74316,  302995,   190575,   10395;
  1, 4082, 235092, 1487200,  1636635,  270270;
  1, 8177, 731731, 6914908, 12122110, 4099095, 135135;
  ...
Reading the table by diagonals produces the triangle A134991.
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222.
  • Frank Avery Haight, "Handbook of the Poisson distribution," John Wiley, 1967. See pages 6,7, but beware of errors. [Haight on page 7 gives five different ways to generate these numbers (see link)].
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 76.
  • S. Roman, The Umbral Calculus, Dover Publications, New York (2005), pp. 129-130.

Crossrefs

Rows: A000247 (k=2), A000478 (k=3), A058844 (k=4).
Row sums: A000296, diagonal: A259877.

Programs

  • Maple
    A008299 := proc(n,k) local i,j,t1; if k<1 or k>floor(n/2) then t1 := 0; else
    t1 := add( (-1)^i*binomial(n, i)*add( (-1)^j*(k - i - j)^(n - i)/(j!*(k - i - j)!), j = 0..k - i), i = 0..k); fi; t1; end; # N. J. A. Sloane, Dec 06 2016
    G:= exp(lambda*(exp(x)-1-x)):
    S:= series(G,x,21):
    seq(seq(coeff(coeff(S,x,n)*n!,lambda,k),k=1..floor(n/2)),n=2..20); # Robert Israel, Jan 15 2020
    T := proc(n, k) option remember; if n < 0 then return 0 fi; if k = 0 then return k^n fi; k*T(n-1, k) + (n-1)*T(n-2, k-1) end:
    seq(seq(T(n,k), k=1..n/2), n=2..9); # Peter Luschny, Feb 11 2021
  • Mathematica
    t[n_, k_] := Sum[ (-1)^i*Binomial[n, i]*Sum[ (-1)^j*(k - i - j)^(n - i)/(j!*(k - i - j)!), {j, 0, k - i}], {i, 0, k}]; Flatten[ Table[ t[n, k], {n, 2, 14}, {k, 1, Floor[n/2]}]] (* Jean-François Alcover, Oct 13 2011, after David Wasserman *)
    Table[Sum[Binomial[n, k - j] StirlingS2[n - k + j, j] (-1)^(j + k), {j, 0, k}], {n, 15}, {k, n/2}] // Flatten (* Eric W. Weisstein, Nov 13 2018 *)
  • PARI
    {T(n, k) = if( n < 1 || 2*k > n, n==0 && k==0, sum(i=0, k, (-1)^i * binomial( n, i) * sum(j=0, k-i, (-1)^j * (k-i-j)^(n-i) / (j! * (k-i-j)!))))}; /* Michael Somos, Oct 19 2014 */
    
  • PARI
    { T(n,k) = sum(i=0,min(n,k), (-1)^i * binomial(n,i) * stirling(n-i,k-i,2) ); } /* Max Alekseyev, Feb 27 2017 */

Formula

T(n,k) = abs(A137375(n,k)).
E.g.f. with additional constant 1: exp(t*(exp(x)-1-x)) = 1 + t*x^2/2! + t*x^3/3! + (t+3*t^2)*x^4/4! + ....
Recurrence relation: T(n+1,k) = k*T(n,k) + n*T(n-1,k-1).
T(n,k) = A134991(n-k,k); A134991(n,k) = T(n+k,k).
More generally, if S_r(n,k) gives the number of set partitions of [n] into k blocks of size at least r then we have the recurrence S_r(n+1,k) = k*S_r(n,k) + binomial(n,r-1)*S_r(n-r+1,k-1) (for this sequence, r=2), with associated e.g.f.: Sum_{n>=0, k>=0} S_r(n,k)*u^k*(t^n/n!) = exp(u*(e^t - Sum_{i=0..r-1} t^i/i!)).
T(n,k) = Sum_{i=0..k} (-1)^i*binomial(n, i)*Sum_{j=0..k-i} (-1)^j*(k-i-j)^(n-i)/(j!*(k-i-j)!). - David Wasserman, Jun 13 2007
G.f.: (R(0)-1)/(x^2*y), where R(k) = 1 - (k+1)*y*x^2/( (k+1)*y*x^2 - (1-k*x)*(1-x-k*x)/R(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Nov 09 2013
T(n,k) = Sum_{i=0..min(n,k)} (-1)^i * binomial(n,i) * Stirling2(n-i,k-i) = Sum_{i=0..min(n,k)} (-1)^i * A007318(n,i) * A008277(n-i,k-i). - Max Alekseyev, Feb 27 2017
T(n, k) = Sum_{j=0..n-k} binomial(j, n-2*k)*E2(n-k, n-k-j) where E2(n, k) are the second-order Eulerian numbers A340556. - Peter Luschny, Feb 11 2021

Extensions

Formula and cross-references from Barbara Haas Margolius (margolius(AT)math.csuohio.edu), Dec 14 2000
Edited by Peter Bala, Dec 04 2011
Edited by N. J. A. Sloane, Jan 24 2020

A032032 Number of ways to partition n labeled elements into sets of sizes of at least 2 and order the sets.

Original entry on oeis.org

1, 0, 1, 1, 7, 21, 141, 743, 5699, 42241, 382153, 3586155, 38075247, 428102117, 5257446533, 68571316063, 959218642651, 14208251423433, 223310418094785, 3699854395380371, 64579372322979335, 1182959813115161773, 22708472725269799933, 455643187943171348103
Offset: 0

Views

Author

Keywords

Comments

From Dennis P. Walsh, Apr 15 2013: (Start)
With m = floor(n/2), a(n) is the number of ways to distribute n different toys to m numbered children such that each child receiving a toy gets at least two toys and, if child k gets no toys, then each child numbered higher than k also gets no toys.
a(n) = sum of n-th row of triangle A200091 for n >= 2. (End)

Examples

			For n=5, a(5)=21 since there are 21 toy distributions satisfying the conditions above. Denoting a distribution by |kid_1 toys|kid_2 toys|, we have the distributions
  |t1,t2,t3,t4,t5|_|, |t1,t2,t3|t4,t5|, |t1,t2,t4|t3,t5|, |t1,t2,t5|t3,t4|, |t1,t3,t4|t2,t5|, |t1,t3,t5|t2,t4|, |t1,t4,t5|t2,t3|, |t2,t3,t4|t1,t5|, |t2,t3,t5|t1,t4|, |t2,t4,t5|t1,t3|, |t3,t4,t5|t1,t2|, |t1,t2|t3,t4,t5|, |t1,t3|t2,t4,t5|, |t1,t4|t2,t3,t5|, |t1,t5|t2,t3,t4|, |t2,t3|t1,t4,t5|, |t2,t4|t1,t3,t5|, |t2,t5|t1,t3,t4|, |t3,t4|t1,t2,t5|, |t3,t5|t1,t2,t4|, and |t4,t5|,t1,t2,t3|. - _Dennis P. Walsh_, Apr 15 2013
		

Crossrefs

Cf. column k=2 of A245732.
Cf. A200091.

Programs

  • Maple
    spec := [ B, {B=Sequence(Set(Z,card>1))}, labeled ]; [seq(combstruct[count](spec, size=n), n=0..30)];
    # second Maple program:
    b:= proc(n) b(n):= `if`(n=0, 1, add(b(n-j)/j!, j=2..n)) end:
    a:= n-> n!*b(n):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jul 29 2014
  • Mathematica
    a[n_] := n! * Sum[ Binomial[k, j] * StirlingS2[n-k+j, j]*j! / (n-k+j)! * (-1)^(k-j), {k, 1, n}, {j, 0, k}]; a[0] = 1; Table[a[n], {n, 0, 22}] (* Jean-François Alcover, Sep 05 2012, from given formula *)
  • PARI
    x='x+O('x^66); Vec(serlaplace( 1/(2+x-exp(x)) ) ) \\ Joerg Arndt, Apr 16 2013

Formula

"AIJ" (ordered, indistinct, labeled) transform of 0, 1, 1, 1...
E.g.f.: 1/(2+x-exp(x)).
a(n) = n! * Sum_{k=1..n} Sum_{j=0..k} C(k,j) * Stirling2(n-k+j,j) * (j!/(n-k+j)!) *(-1)^(k-j); a(0)=1. - Vladimir Kruchinin, Feb 01 2011
a(n) ~ n! / ((r-1)*(r-2)^(n+1)), where r = -LambertW(-1,-exp(-2)) = 3.14619322062... - Vaclav Kotesovec, Oct 08 2013
a(0) = 1; a(n) = Sum_{k=2..n} binomial(n,k) * a(n-k). - Ilya Gutkovskiy, Feb 09 2020
a(n) = Sum_{s in S_n^0} Product_{i=1..n} binomial(i,s(i)-1), where s ranges over the set S_n^0 of derangements of [n], i.e., the permutations of [n] without fixed points. - Jose A. Rodriguez, Feb 02 2021

A052515 Number of ordered pairs of complementary subsets of an n-set with both subsets of cardinality at least 2.

Original entry on oeis.org

0, 0, 0, 0, 6, 20, 50, 112, 238, 492, 1002, 2024, 4070, 8164, 16354, 32736, 65502, 131036, 262106, 524248, 1048534, 2097108, 4194258, 8388560, 16777166, 33554380, 67108810, 134217672, 268435398, 536870852, 1073741762
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

a(n) is the number of binary sequences of length n having at least two 0's and at least two 1's. a(4)=6 because there are six binary sequences of length four that have two or more 0's and two or more 1's: 0011, 0101, 0110, 1100, 1010, 1001. - Geoffrey Critzer, Feb 11 2009
For n>3, a(n) is also the sum of those terms from the n-th row of Pascal's triangle which also occur in A006987: 6, 10+10, 15+20+15, 21+35+35+21,... - Douglas Latimer, Apr 02 2012
From Dennis P. Walsh, Apr 09 2013: (Start)
Column 2 of triangle A200091.
Number of doubly-surjective functions f:[n]->[2].
Number of ways to distribute n different toys to 2 children so that each child gets at least 2 toys. (End)
a(n) is the number of subsets of an n-set of cardinality k with 2 <= k <= n - 2. - Rick L. Shepherd, Dec 05 2014

Programs

  • Magma
    m:=35; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!( (Exp(x)-1-x)^2 )); [0,0,0,0] cat [Factorial(n+3)*b[n]: n in [1..m-5]]; // G. C. Greubel, May 13 2019
    
  • Maple
    Pairs spec := [S,{S=Prod(B,B),B=Set(Z,2 <= card)},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
  • Mathematica
    Join[{0,0,0}, LinearRecurrence[{4,-5,2}, {0,6,20}, 35]] (* G. C. Greubel, May 13 2019 *)
    With[{nn=30},CoefficientList[Series[(Exp[x]-x-1)^2,{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, May 29 2023 *)
  • PARI
    concat([0,0,0,0],Vec((6-4*x)/(1-x)^2/(1-2*x)+O(x^35))) \\ Charles R Greathouse IV, Apr 03 2012
    
  • PARI
    x='x+O('x^35); concat([0,0,0,0],Vec(serlaplace((exp(x)-x-1)^2))) \\ Joerg Arndt, Apr 10 2013
    
  • Sage
    (2*x^4*(3-2*x)/((1-x)^2*(1-2*x))).series(x, 35).coefficients(x, sparse=False) # G. C. Greubel, May 13 2019

Formula

E.g.f.: (exp(x) - x - 1)^2. - Joerg Arndt, Apr 10 2013
n*a(n+2) - (1+3*n)*a(n+1) + 2(1+n)*a(n) = 0, with a(0) = .. = a(3) = 0, a(4) = 6.
For n>2, a(n) = 2^n - 2n - 2 = A005803(n) - 2 = A070313(n) - 1 = A071099(n) - A071099(n+1) + 1 = 2*A000247(n-1). - Ralf Stephan, Jan 11 2004
G.f.: 2*x^4*(3-2*x)/((1-x)^2*(1-2*x)). - Colin Barker, Feb 19 2012

Extensions

More terms from Ralf Stephan, Jan 11 2004
Definition corrected by Rainer Rosenthal, Feb 12 2010
Definition further clarified by Rick L. Shepherd, Dec 05 2014

A200092 The number of ways of putting n labeled items into k labeled boxes so that each box receives at least 3 objects.

Original entry on oeis.org

1, 1, 1, 1, 20, 1, 70, 1, 182, 1, 420, 1680, 1, 912, 12600, 1, 1914, 62370, 1, 3938, 256410, 369600, 1, 8008, 949806, 4804800, 1, 16172, 3297294, 38678640, 1, 32526, 10966956, 248047800, 168168000
Offset: 3

Views

Author

Peter Bala, Dec 04 2011

Keywords

Comments

Equivalently, the number of ordered set partitions of the set [n] into k blocks of size at least three. When the boxes are unlabeled we obtain A059022.

Examples

			Table begins
  n\k |  1     2       3
  ----+-----------------
   3  |  1
   4  |  1
   5  |  1
   6  |  1    20
   7  |  1    70
   8  |  1   182
   9  |  1   420    1680
  10  |  1   912   12600
  11  |  1  1914   62370
  ...
T(6,2) = 20: The arrangements of 6 objects into 2 boxes { } and [ ] so that each box contains at least 3 items are {1,2,3}[4,5,6], {1,2,4}[3,5,6], {1,2,5}[3,4,6], {1,2,6}[3,4,5], {1,3,4}[2,5,6], {1,3,5}[2,4,6], {1,3,6}[2,4,5], {1,4,5}[2,3,6], {1,4,6}[2,3,5], {1,5,6}[2,3,4] and the 10 other possibilities where the contents of a pair of boxes are swapped.
		

Crossrefs

Formula

E.g.f. with additional constant 1: 1/(1 - t*(exp(x) - 1 - x - x^2/2!)) = 1 + t*x^3/3! + t*x^4/4! + t*x^5/5! + (t+20*t^2)*x^6/6! + ....
Recurrence relation: T(n+1,k) = k*(T(n,k) + n*(n-1)/2*T(n-2,k-1)). T(n,k) = k!*A059022(n,k).

A224541 Number of doubly-surjective functions f:[n]->[3].

Original entry on oeis.org

90, 630, 2940, 11508, 40950, 137610, 445896, 1410552, 4390386, 13514046, 41278068, 125405532, 379557198, 1145747538, 3452182656, 10388002848, 31230066186, 93828607686, 281775226860, 845929656900, 2539047258150, 7619759016090, 22864712861880, 68605412870088
Offset: 6

Views

Author

Dennis P. Walsh, Apr 09 2013

Keywords

Comments

Third column of A200091.
Also, a(n) is (i) the number of length-n words on the alphabet A, B, and C with each letter occurring at least twice; (ii) the number of ways to distribute n different toys to 3 different children so that each child gets at least 2 toys; (iii) the number of ways to put n numbered balls into 3 labeled boxes so that each box gets at least 2 balls; (iv) the number of n-digit positive integers consisting only of the digits 1, 2, and 3 with each of these digits appearing at least twice. A doubly-surjective function f has size at least 2 for each pre-image set, that is, |f^-1(y)|>=2 for each element y of the codomain.[Note that a surjective function has |f^-1(y)|>=1.] The triangle A200091 provides the number of doubly-surjective functions f:[n]->[k]. Column 3 of triangle A200091 is a(n).
Sequence A052515 is the number of doubly-surjective functions f:[n]->[2] with exponential generating function (exp(x)-x-1)^2. In general, the number of doubly-surjective functions f:[n]->[k] has exponential generating function (exp(x)-x-1)^k.

Examples

			For n=6 we have a(6)=90 since there are 90 six-digit  positive integers using only digits 1, 2, and 3 with each of those digits appearing at least twice. The first 30 of the ninety, namely those with initial digit 1, are given below:
112233, 112323, 112332, 113223, 113232, 113322,
121233, 121323, 121332, 122133, 122313, 122331,
123123, 123132, 123213, 123231, 123312, 123321,
131223, 131232, 131322, 132123, 132132, 132213,
132231, 132312, 132321, 133122, 133212, 133221.
		

Crossrefs

Cf. A052515, the number of doubly-surjective functions f:[n]->[2].

Programs

  • Maple
    seq(3^n-3*2^n-3*n*2^(n-1)+3+3*n+3*n^2, n=6..40);
  • Mathematica
    With[{nn=40},Drop[CoefficientList[Series[(Exp[x]-x-1)^3,{x,0,nn}],x] Range[0,nn]!,6]] (* Harvey P. Dale, Oct 01 2015 *)
  • PARI
    x='x+O('x^66); Vec(serlaplace((exp(x)-x-1)^3)) \\ Joerg Arndt, Apr 10 2013

Formula

a(n) = 3^n-3*2^n-3*n*2^(n-1)+3+3*n+3*n^2.
E.g.f.: (exp(x)-x-1)^3.
From Alois P. Heinz, Apr 10 2013: (Start)
a(n) = 6*A000478(n).
G.f.: -6*(12*x^3-40*x^2+45*x-15)*x^6 / ((3*x-1)*(2*x-1)^2*(x-1)^3).
(End)

A224542 Number of doubly-surjective functions f:[n]->[4].

Original entry on oeis.org

2520, 30240, 226800, 1367520, 7271880, 35692800, 165957792, 742822080, 3234711480, 13803744864, 58021888080, 241116750624, 993313349544, 4064913201216, 16549636147968, 67112688842496, 271323921459096, 1094303232174240, 4405390451382960, 17709538489849440
Offset: 8

Views

Author

Dennis P. Walsh, Apr 09 2013

Keywords

Comments

Fourth column of A200091: A200091(n,4)=a(n).
Also, a(n) is (i) the number of length-n words on the alphabet A, B, C, and D with each letter of the alphabet occurring at least twice; (ii) the number of ways to distribute n different toys to 4 children so that each child gets at least two toys; (iii) the number of ways to put n numbered balls into 4 labeled boxes so that each box gets at least two balls; (iv) the number of n-digit positive integers consisting of only digits 1,2,3, and 4 with each of these digits appearing at least twice.
A doubly-surjective function f:D->C is such that the pre-image set f^-1(y) has size at least 2 for each y in C.
Triangle A200091 provides the number of doubly-surjective functions f from a set of size n onto a set of size k. Hence a(n) is column 4 of A200091.

Examples

			a(9) = 30240 since there are 30240 ways to distribute 9 different toys to 4 children so that each child gets at least 2 toys. One child must get 3 toys and the other children get 2 toys each. There are 4 ways to pick the lucky kid. There are C(9,3) ways to choose the 3 toys for the lucky kid. There are 6!/(2!)^3 ways to distribute the remaining 6 toys among the 3 kids. We obtain 4*C(9,3)*6!/8=30240.
		

Crossrefs

Programs

  • Maple
    seq(eval(diff((exp(x)-x-1)^4,x$n),x=0),n=8..40);
  • Mathematica
    nn=27; Drop[Range[0,nn]! CoefficientList[Series[(Exp[x]-x-1)^4, {x,0,nn}], x], 8] (* Geoffrey Critzer, Sep 28 2013 *)
  • PARI
    my(x='x+O('x^66)); Vec(serlaplace((exp(x)-x-1)^4)) /* Joerg Arndt, Apr 10 2013 */

Formula

a(n) = 4^n-4*3^n-4*n*3^(n-1)+(9*n+3*n^2)*2^(n-1)+6*2^n-4-8*n-4*n^3;
a(n) = sum(n!/(i!*j!*k!*m!)) over such that i,j,k, and m are all at least 2 and i+j+k+m=n.
E.g.f.: (exp(x)-x-1)^4.
a(n) = 24*A058844(n). - Alois P. Heinz, Apr 10 2013
G.f.: 24*x^8*(288*x^6-1560*x^5+3500*x^4-4130*x^3+2625*x^2-840*x+105) / ((x-1)^4*(2*x-1)^3*(3*x-1)^2*(4*x-1)). - Colin Barker, Jun 04 2013
Showing 1-6 of 6 results.