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-10 of 21 results. Next

A090802 Triangle read by rows: a(n,k) = number of k-length walks in the Hasse diagram of a Boolean algebra of order n.

Original entry on oeis.org

1, 2, 1, 4, 4, 2, 8, 12, 12, 6, 16, 32, 48, 48, 24, 32, 80, 160, 240, 240, 120, 64, 192, 480, 960, 1440, 1440, 720, 128, 448, 1344, 3360, 6720, 10080, 10080, 5040, 256, 1024, 3584, 10752, 26880, 53760, 80640, 80640, 40320
Offset: 0

Views

Author

Ross La Haye, Feb 10 2004

Keywords

Comments

Row sums = A010842(n); Row sums from column 1 on = A066534(n) = n*A010842(n-1) = A010842(n) - 2^n.
a(n,k) = n! = k! = A000142(n) for n = k; a(n,n-1) = 2*n! = A052849(n) for n > 1; a(n,n-2) = 2*n! = A052849(n) for n > 2; a(n,n-3) = (4/3)*n! = A082569(n) for n > 3; a(n,n-1)/a(2,1) = n!/2! = A001710(n) for n > 1; a(n,n-2)/ a(3,1) = n!/3! = A001715(n) for n > 2; a(n,n-3)/a(4,1) = n!/4! = A001720(n) for n > 3.
a(2k, k) = A052714(k+1). a(2k-1, k) = A034910(k).
a(n,0) = A000079(n); a(n,1) = A001787(n) = row sums of A003506; a(n,2) = A001815(n) = 2!*A001788(n-1); a(n,3) = A052771(n) = 3!*A001789(n); a(n,4) = A052796(n) = 4!*A003472(n); ceiling[a(n,1) / 2] = A057711(n); a(n,5) = 5!*A054849(n).
In a class of n students, the number of committees (of any size) that contain an ordered k-sized subcommittee is a(n,k). - Ross La Haye, Apr 17 2006
Antidiagonal sums [1,2,5,12,30,76,198,528,1448,4080,...] appear to be binomial transform of A000522 interleaved with itself, i.e., 1,1,2,2,5,5,16,16,65,65,... - Ross La Haye, Sep 09 2006
Let P(A) be the power set of an n-element set A. Then a(n,k) = the number of ways to add k elements of A to each element x of P(A) where the k elements are not elements of x and order of addition is important. - Ross La Haye, Nov 19 2007
The derivatives of x^n evaluated at x=2. - T. D. Noe, Apr 21 2011

Examples

			{1};
{2, 1};
{4, 4, 2};
{8, 12, 12, 6};
{16, 32, 48, 48, 24};
{32, 80, 160, 240, 240, 120};
{64, 192, 480, 960, 1440, 1440, 720};
{128, 448, 1344, 3360, 6720, 10080, 10080, 5040};
{256, 1024, 3584, 10752, 26880, 53760, 80640, 80640, 40320}
a(5,3) = 240 because P(5,3) = 60, 2^(5-3) = 4 and 60 * 4 = 240.
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[n!/(n-k)! * 2^(n-k), {n, 0, 8}, {k, 0, n}]] (* Ross La Haye, Feb 10 2004 *)

Formula

a(n, k) = 0 for n < k. a(n, k) = k!*C(n, k)*2^(n-k) = P(n, k)*2^(n-k) = (2n)!!/((n-k)!*2^k) = k!*A038207(n, k) = A068424*2^(n-k) = Sum[C(n, m)*P(n-m, k), {m, 0, n-k}] = Sum[C(n, n-m)*P(n-m, k), {m, 0, n-k}] = n!*Sum[1/(m!*(n-m-k)!), {m, 0, n-k}] = k!*Sum[C(n, m)*C(n-m, k), {m, 0, n-k}] = k!*Sum[C(n, n-m)*C(n-m, k), {m, 0, n-k}] = k!*C(n, k)*Sum[C(n-k, n-m-k), {m, 0, n-k}] = k!*C(n, k)*Sum[C(n-k, m), {m, 0, n-k}] for n >= k.
a(n, k) = 0 for n < k. a(n, k) = n*a(n-1, k-1) for n >= k >= 1.
E.g.f. (by columns): exp(2x)*x^k.

Extensions

More terms from Ray Chandler, Feb 26 2004
Entry revised by Ross La Haye, Aug 18 2006

A002999 Expansion of (1 + x*exp(x))^2.

Original entry on oeis.org

1, 2, 6, 18, 56, 170, 492, 1358, 3600, 9234, 23060, 56342, 135192, 319514, 745500, 1720350, 3932192, 8912930, 20054052, 44826662, 99614760, 220201002, 484442156, 1061158958, 2315255856, 5033164850, 10905190452, 23555211318, 50734301240, 108984795194, 233538846780
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of binary words of length n where exactly one of each kind of letter that appears is marked. - John Tyler Rascoe, Jul 16 2025

Examples

			a(2) = 6 counts: (1#,1), (1,1#), (1#,2#), (2#,1#), (2#,2), (2,2#) where # denotes a mark. - _John Tyler Rascoe_, Jul 16 2025
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[1+(2x(7x^3-10x^2+5x-1))/((x-1)^2 (2x-1)^3), {x,0,30}],x]  (* Harvey P. Dale, Apr 04 2011 *)
    Table[If[n == 0, 1, (n^2 - n) 2^n/4 + 2*n], {n, 0, 30}] (* T. D. Noe, Apr 04 2011 *)
  • PARI
    A_x(N) = {my(x='x+O('x^(N+1))); Vec(serlaplace((1+x*exp(x))^2))} \\ John Tyler Rascoe, Jul 16 2025

Formula

From Ralf Stephan, Sep 02 2003: (Start)
a(0) = 1, a(n) = (n^2 - n)*2^n/4 + 2*n.
a(n) = A003013(n) + n = A001815(n) + 2*n. (End)
G.f.: 1+(2*x*(7*x^3-10*x^2+5*x-1))/((x-1)^2*(2*x-1)^3). - Harvey P. Dale, Apr 04 2011

A046718 Number of permutations of [ n ] with exactly one 132-pattern and two 123-patterns.

Original entry on oeis.org

1, 4, 14, 47, 152, 472, 1408, 4048, 11264, 30464, 80384, 207616, 526336, 1312768, 3227648, 7835648, 18808832, 44695552, 105250816, 245825536, 569901056, 1312292864, 3003121664, 6833569792, 15468593152, 34846277632, 78148272128, 174533378048, 388291887104
Offset: 4

Views

Author

Keywords

Examples

			a(4) = 1: 1324.
a(5) = 4: 24315, 24351, 41325, 51324.
a(6) = 14: 354216, 354261, 354612, 354621, 435162, 462135, 524316, 524361, 541326, 561324, 624315, 624351, 641325, 651324.
		

Crossrefs

Programs

  • Maple
    a:= n-> (<<0|1|0|0>, <0|0|1|0>, <0|0|0|1>, <-16|32|-24|8>>^(n-4).
            <<1, 4, 14, 47>>)[1, 1]:
    seq(a(n), n=4..30);  # Alois P. Heinz, Oct 01 2012
  • Mathematica
    LinearRecurrence[{8, -24, 32, -16}, {1, 4, 14, 47}, 30] (* Jean-François Alcover, Aug 18 2018 *)
  • Sage
    def LinearRecurrence4(a0,a1,a2,a3,a4,a5,a6,a7):
        x, y, z, u = Integer(a0),Integer(a1),Integer(a2),Integer(a3)
        yield x
        while True:
            x, y, z, u = y, z, u, a7*x+a6*y+a5*z+a4*u
            yield x
    A046718 = LinearRecurrence4(1, 4, 14, 47, 8, -24, 32, -16)
    [next(A046718) for i in range(29)] # Peter Luschny, Oct 02 2012

Formula

G.f.: -x^4*(x^3-6*x^2+4*x-1)/(2*x-1)^4.
a(n) = 2^(n-8)*(n^3-11*n^2+54*n-88). - R. J. Mathar, Oct 02 2012

Extensions

Edited at the suggestion of R. J. Mathar by Alois P. Heinz, Oct 01 2012

A100381 a(n) = 2^n*binomial(n,2).

Original entry on oeis.org

0, 0, 4, 24, 96, 320, 960, 2688, 7168, 18432, 46080, 112640, 270336, 638976, 1490944, 3440640, 7864320, 17825792, 40108032, 89653248, 199229440, 440401920, 968884224, 2122317824, 4630511616, 10066329600, 21810380800, 47110422528
Offset: 0

Views

Author

Jorge Coveiro, Dec 30 2004

Keywords

Comments

From Enrique Navarrete, Jun 13 2023: (Start)
a(n) is the number of ways to partition the set [n]={1,2,...,n} into two sets S,T and select 2 elements in total (from either S or T or both).
Example. For n=4, sample partitions are given (where S(i),T(j) means i elements are selected from S, j elements are selected from T):
S={ }, T={1,2,3,4}: partition [4] in 1 way, S(0),T(2) (6 ways);
S={1}, T={2,3,4}: partition [4] in 4 such ways, S(1),T(1) or S(0),T(2) (24 ways);
S={1,2}, T={3,4}: partition [4], in such 6 ways, S(1),T(1) or S(0),T(2) or S(2),T(0) (36 ways);
S={1,2,3}, T={4}: partition [4] in 4 such ways, S(1),T(1) or S(2),T(0) (24 ways);
S={1,2,3,4}, T={ }: partition [4] in 1 way, S(2),T(0) (6 ways). (End)

References

  • Jolley, Summation of Series, Dover (1961), eq (214) page 40.

Crossrefs

Programs

  • Maple
    seq(2^n*binomial(n,2),n=0..20);
  • Mathematica
    Range[0,20]! CoefficientList[Series[2x^2 Exp[2x],{x,0,20}],x]
    Table[2^n Binomial[n,2],{n,0,30}] (* or *) LinearRecurrence[{6,-12,8},{0,0,4},30] (* Harvey P. Dale, Aug 15 2020 *)
  • PARI
    a(n)=binomial(n,2)<Charles R Greathouse IV, Oct 16 2015

Formula

Sum_{n>=2} 1/a(n) = 1 - log(2) = 0.3068528.... - Graeme McRae, Jul 28 2006
a(n) = Sum_{k=0..n} k*2^k = 2*A001815(n). - Zerinvary Lajos, Oct 09 2006
E.g.f.: 2*x^2*exp(2x).
a(n) = 4*A001788(n-1). - Johannes W. Meijer, Jun 27 2009
Sum_{j=1..k} (j+2)/a(j+1) = 1 - 1/((k+1)*2^k). [Jolley]
G.f.: -4*x^2 / (2*x-1)^3. - R. J. Mathar, Oct 05 2011
Sum_{n>=2} (-1)^n/a(n) = 3*log(3/2) - 1. - Amiram Eldar, Jul 20 2020
From Peter Bala Mar 04 2024: (Start)
Sum_{k = 2..n+2} 1/a(k) = 1/(4 - 4/(7 - 12/(10 - ... - 2*n*(n + 1)/(3*n + 4)))).
Sum_{k = 2..n+2} (-1)^k/a(k) = 1/(4 + 4/(5 + 12/(6 + ... + 2*n*(n + 1)/(n + 4)))).
Letting n -> oo in the above gives the continued fraction representations
1 - log(2) = Sum_{k >= 2} 1/a(k) = 1/(4 - 4/(7 - 12/(10 - ... - 2*n*(n + 1)/((3*n + 4) - ... )))) (an equivalent continued fraction for 1 - log(2) was conjectured by the Ramanujan machine) and
3*log(3/2) - 1 = Sum_{k >= 2} (-1)^k/a(k) = 1/(4 + 4/(5 + 12/(6 + ... + 2*n*(n + 1)/((n + 4) + ... )))). (End)

A118441 Triangle L, read by rows, equal to the matrix log of A118435, with the property that L^2 consists of a single diagonal (two rows down from the main diagonal).

Original entry on oeis.org

0, 1, 0, -4, 2, 0, -12, 12, 3, 0, 32, -48, -24, 4, 0, 80, -160, -120, 40, 5, 0, -192, 480, 480, -240, -60, 6, 0, -448, 1344, 1680, -1120, -420, 84, 7, 0, 1024, -3584, -5376, 4480, 2240, -672, -112, 8, 0, 2304, -9216, -16128, 16128, 10080, -4032, -1008, 144, 9, 0
Offset: 0

Views

Author

Paul D. Hanna, Apr 28 2006

Keywords

Comments

L = log(A118435) = log(H*[C^-1]*H], where C=Pascal's triangle and H=A118433 where H^2 = I (identity matrix).

Examples

			The matrix log, L = log(H*[C^-1]*H], begins:
     0;
     1,     0;
    -4,     2,      0;
   -12,    12,      3,     0;
    32,   -48,    -24,     4,     0;
    80,  -160,   -120,    40,     5,     0;
  -192,   480,    480,  -240,   -60,     6,     0;
  -448,  1344,   1680, -1120,  -420,    84,     7,   0;
  1024, -3584,  -5376,  4480,  2240,  -672,  -112,   8,  0;
  2304, -9216, -16128, 16128, 10080, -4032, -1008, 144,  9,  0;
  ...
The matrix square, L^2, is a single diagonal:
  0;
  0, 0;
  2, 0,  0;
  0, 6,  0,  0;
  0, 0, 12,  0,  0;
  0, 0,  0, 20,  0,  0;
  0, 0,  0,  0, 30,  0,  0;
  ...
From _Peter Luschny_, Apr 23 2020: (Start)
In unsigned form and without the main diagonal, as computed by the Maple script:
  [0], [0]
  [1], [1]
  [2], [4,   2]
  [3], [12,  12,   3]
  [4], [32,  48,   24,   4]
  [5], [80,  160,  120,  40,   5]
  [6], [192, 480,  480,  240,  60,  6]
  [7], [448, 1344, 1680, 1120, 420, 84, 7] (End)
		

Crossrefs

Cf. A118435 (exp(L)), A118442 (column 0), A118443 (row sums), A027471 (unsigned row sums); A118433 (self-inverse triangle), A001815 (column 1?), A001789 (third of column 2?).

Programs

  • Maple
    # Generalized Worpitzky transform of the harmonic numbers.
    CL := p -> PolynomialTools:-CoefficientList(expand(p), x):
    H := n -> add(1/k, k=1..n):
    Trow := proc(n) local k,v; if n=0 then return [0] fi;
    add(add((-1)^(n-v)*binomial(k,v)*H(k)*(-x+v-1)^n, v=0..k), k=0..n); CL(%) end:
    for n from 0 to 7 do Trow(n) od; # Peter Luschny, Apr 23 2020
  • Mathematica
    nmax = 12;
    h[n_, k_] := Binomial[n, k]*(-1)^(Quotient[n+1, 2] - Quotient[k, 2]+n-k);
    H = Table[h[n, k], {n, 0, nmax}, {k, 0, nmax}];
    Cn = Table[Binomial[n, k], {n, 0, nmax}, {k, 0, nmax}];
    L = MatrixLog[H.Inverse[Cn].H ];
    Table[L[[n+1, k+1]], {n, 0, nmax}, {k, 0, n}] // Flatten (* Jean-François Alcover, Apr 08 2024 *)
  • PARI
    /* From definition of L as matrix log of H*C^-1*H: */
    {L(n,k)=local(H=matrix(n+1,n+1,r,c,if(r>=c,binomial(r-1,c-1)*(-1)^(r\2-(c-1)\2+r-c))),C=matrix(n+1,n+1,r,c,if(r>=c,binomial(r-1,c-1))),N=(H*C^-1*H)); Log=sum(p=1,n+1,-(N^0-N)^p/p);Log[n+1,k+1]}
    for(n=0, 10, for(k=0, n, print1(L(n, k), ", ")); print(""))
    
  • PARI
    /* The matrix power L^m is given by: */
    {L(n,k,m)=if(m%2==0,if(n==k+m,n!/k!*2^(n-k-m)/(n-k-m)!), if(n>=k+m,n!/k!*2^(n-k-m)/(n-k-m)!*(-1)^(m\2+(n+1)\2-k\2+n-k)))}
    for(n=0, 10, for(k=0, n, print1(L(n, k,1), ", ")); print(""))

Formula

For even exponents of L, L^(2m) is a single diagonal:
if n == k+2m, then [L^(2m)](n,k) = n!/k!*2^(n-k-2m)/(n-k-2m)!; else if n != k+2m: [L^(2m)](n,k) = 0.
For odd exponents of L:
if n >= k+2m+1, then [L^(2m+1)](n,k) = n!/k!*2^(n-k-2m-1)/(n-k-2m-1)!*(-1)^(m+[(n+1)/2]-[k/2]+n-k); else if n < k+2m+1: [L^(2m)](n,k) = 0.
Unsigned row sums equals A027471(n+1) = n*3^(n-1).

A119275 Inverse of triangle related to Padé approximation of exp(x).

Original entry on oeis.org

1, -2, 1, 0, -6, 1, 0, 12, -12, 1, 0, 0, 60, -20, 1, 0, 0, -120, 180, -30, 1, 0, 0, 0, -840, 420, -42, 1, 0, 0, 0, 1680, -3360, 840, -56, 1, 0, 0, 0, 0, 15120, -10080, 1512, -72, 1, 0, 0, 0, 0, -30240, 75600, -25200, 2520, -90, 1, 0, 0, 0, 0, 0, -332640, 277200, -55440, 3960, -110, 1
Offset: 0

Views

Author

Paul Barry, May 12 2006

Keywords

Comments

Inverse of A119274.
Row sums are (-1)^(n+1)*A000321(n+1).
Bell polynomials of the second kind B(n,k)(1,-2). - Vladimir Kruchinin, Mar 25 2011
Also the inverse Bell transform of the quadruple factorial numbers Product_{k=0..n-1} (4*k+2) (A001813) giving unsigned values and adding 1,0,0,0,... as column 0. For the definition of the Bell transform see A264428 and for cross-references A265604. - Peter Luschny, Dec 31 2015

Examples

			Triangle begins
1,
-2, 1,
0, -6, 1,
0, 12, -12, 1,
0, 0, 60, -20, 1,
0, 0, -120, 180, -30, 1,
0, 0, 0, -840, 420, -42, 1,
0, 0, 0, 1680, -3360, 840, -56, 1,
0, 0, 0, 0, 15120, -10080, 1512, -72, 1
Row 4: D(x^4) = (1 - x*(d/dx)^2 + x^2/2!*(d/dx)^4 - ...)(x^4) = x^4 - 12*x^3 + 12*x^2.
		

Crossrefs

Cf. A059344 (unsigned row reverse).

Programs

  • Maple
    # The function BellMatrix is defined in A264428.
    # Adds (1,0,0,0, ..) as column 0.
    BellMatrix(n -> `if`(n<2,(n+1)*(-1)^n,0), 9); # Peter Luschny, Jan 27 2016
  • Mathematica
    Table[(-1)^(n - k) (n - k)!*Binomial[n + 1, k + 1] Binomial[k + 1, n - k], {n, 0, 10}, {k, 0, n}] // Flatten (* Michael De Vlieger, Oct 12 2016 *)
    BellMatrix[f_Function, len_] := With[{t = Array[f, len, 0]}, Table[BellY[n, k, t], {n, 0, len - 1}, {k, 0, len - 1}]];
    rows = 12;
    M = BellMatrix[If[#<2, (#+1) (-1)^#, 0]&, rows];
    Table[M[[n, k]], {n, 2, rows}, {k, 2, n}] // Flatten (* Jean-François Alcover, Jun 24 2018, after Peter Luschny *)
  • Sage
    # uses[inverse_bell_matrix from A265605]
    # Unsigned values and an additional first column (1,0,0, ...).
    multifact_4_2 = lambda n: prod(4*k + 2 for k in (0..n-1))
    inverse_bell_matrix(multifact_4_2, 9) # Peter Luschny, Dec 31 2015

Formula

T(n,k) = [k<=n]*(-1)^(n-k)*(n-k)!*C(n+1,k+1)*C(k+1,n-k).
From Peter Bala, May 07 2012: (Start)
E.g.f.: exp(x*(t-t^2)) - 1 = x*t + (-2*x+x^2)*t^2/2! + (-6*x^2+x^3)*t^3/3! + (12*x^2-12*x^3+x^4)*t^4/4! + .... Cf. A059344. Let D denote the operator sum {k >= 0} (-1)^k/k!*x^k*(d/dx)^(2*k). The n-th row polynomial R(n,x) = D(x^n) and satisfies the recurrence equation R(n+1,x) = x*R(n,x)-2*n*x*R(n-1,x). The e.g.f. equals D(exp(x*t)).
(End)
From Tom Copeland, Oct 11 2016: (Start)
With initial index n = 1 and unsigned, these are the partition row polynomials of A130561 and A231846 with c_1 = c_2 = x and c_n = 0 otherwise. The first nonzero, unsigned element of each diagonal is given by A001813 (for each row, A001815) and dividing along the corresponding diagonal by this element generates A098158 with its first column removed (cf. A034839 and A086645).
The n-th polynomial is generated by (x - 2y d/dx)^n acting on 1 and then evaluated at y = x, e.g., (x - 2y d/dx)^2 1 = (x - 2y d/dx) x = x^2 - 2y evaluated at y = x gives p_2(x) = -2x + x^2.
(End)

A155864 Triangle T(n,k) = n*(n-1)*binomial(n-2, k-1) for 1 <= k <= n-1, n >= 2, and T(n,0) = T(n,n) = 1 for n >= 0, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 6, 6, 1, 1, 12, 24, 12, 1, 1, 20, 60, 60, 20, 1, 1, 30, 120, 180, 120, 30, 1, 1, 42, 210, 420, 420, 210, 42, 1, 1, 56, 336, 840, 1120, 840, 336, 56, 1, 1, 72, 504, 1512, 2520, 2520, 1512, 504, 72, 1, 1, 90, 720, 2520, 5040, 6300, 5040, 2520, 720, 90, 1
Offset: 0

Views

Author

Roger L. Bagula, Jan 29 2009

Keywords

Examples

			Triangle begins:
  1;
  1,  1;
  1,  2,   1;
  1,  6,   6,    1;
  1, 12,  24,   12,    1;
  1, 20,  60,   60,   20,    1;
  1, 30, 120,  180,  120,   30,    1;
  1, 42, 210,  420,  420,  210,   42,    1;
  1, 56, 336,  840, 1120,  840,  336,   56,   1;
  1, 72, 504, 1512, 2520, 2520, 1512,  504,  72,  1;
  1, 90, 720, 2520, 5040, 6300, 5040, 2520, 720, 90, 1;
  ...
		

Crossrefs

Programs

  • Magma
    A155864:= func< n,k | k eq 0 or k eq n select 1 else n*(n-1)*Binomial(n-2, k-1) >;
    [A155864(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jun 04 2021
    
  • Mathematica
    (* First program *)
    p[n_, x_]:= p[n,x]= If[n==0, 1, 1 + x^n + x*D[(x+1)^(n), {x, 2}]];
    Flatten[Table[CoefficientList[p[n,x], x], {n, 0, 12}]]
    (* Second program *)
    Table[If[k==0 || k==n, 1, 2*Binomial[n, 2]*Binomial[n-2, k-1]], {n,0,12}, {k,0,n}] //Flatten (* G. C. Greubel, Jun 04 2021 *)
  • Maxima
    T(n, k) := ratcoef(x^n + n*(n-1)*x*(x+1)^(n-2) + (1 + (-1)^(2^n))/2, x, k)$ create_list(T(n, k), n, 0, 12, k, 0, n); /* Franck Maminirina Ramaharo, Dec 04 2018 */
    
  • Sage
    def A155864(n,k): return 1 if (k==0 or k==n) else n*(n-1)*binomial(n-2,k-1)
    flatten([[A155864(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jun 04 2021

Formula

T(n, k) = coefficients of p(n, x), where p(n, x) = 1 + x^n + x*((d/dx)^2 (1+x)^n), with T(0, 0) = 1.
From Franck Maminirina Ramaharo, Dec 04 2018: (Start)
T(n, k) = n*(n-1)*binomial(n-2, k-1) with T(n, 0) = T(n, n) = 1.
n-th row polynomial is x^n + n*(n - 1)*x*(x + 1)^(n - 2) + (1 + (-1)^(2^n))/2.
G.f.: 1/(1 - y) + 1/(1 - x*y) + 2*x*y^2/(1 - y - x*y)^3 - 1.
E.g.f.: exp(y) + exp(x*y) + x*y^2*exp(y + x*y) - 1. (End)
Sum_{k=0..n} T(n, k) = 2 - [n=0] + A001815(n). - G. C. Greubel, Jun 04 2021

Extensions

Edited and name clarified by Franck Maminirina Ramaharo, Dec 04 2018

A199673 Number of ways to form k labeled groups, each with a distinct leader, using n people. Triangle T(n,k) = n!*k^(n-k)/(n-k)! for 1 <= k <= n.

Original entry on oeis.org

1, 2, 2, 3, 12, 6, 4, 48, 72, 24, 5, 160, 540, 480, 120, 6, 480, 3240, 5760, 3600, 720, 7, 1344, 17010, 53760, 63000, 30240, 5040, 8, 3584, 81648, 430080, 840000, 725760, 282240, 40320, 9, 9216, 367416, 3096576, 9450000, 13063680, 8890560, 2903040, 362880
Offset: 1

Views

Author

Dennis P. Walsh, Nov 08 2011

Keywords

Comments

T(n,1)=n since there are n choices for the leader of the single group. Also, T(n,n)=n! since each of the n groups consist solely of a leader and there are n! ways to assign the n people to the n labeled groups.
In general, T(n,k) = n!*k^(n-k)/(n-k)! since there are n!/(n-k)! ways to assign leaders to the k labeled groups and there are k^(n-k) ways to map the remaining (n-k) people to the k groups.
T(n,k) is the number of functions of [n] to an arbitrary k-subset of [n], where each of the k target values is used at least once.
The number of ways to distribute n different toys among k girls and k boys to that each girl gets exactly one toy. - Dennis P. Walsh, Sep 10 2012

Examples

			T(3,2)=12 since there are 12 ways to form group 1 and group 2, both with leaders, using people p1, p2, and p3, as illustrated below. The leader will be denoted Lj if person pj is designated the leader of the group.
Group 1   Group 2
{L1,p2}   {L3}
{L1,p3}   {L2}
{L1}      {L2,p3}
{L1}      {p2,L3}
{L2,p1}   {L3}
{L2,p3}   {L1}
{L2}      {L1,p3}
{L2}      {p1,L3}
{L3,p2}   {L1}
{L3,p1}   {L2}
{L3}      {L1,p2}
{L3}      {p1,L2}
First rows of triangle T(n,k):
  1;
  2,    2;
  3,   12,      6;
  4,   48,     72,      24;
  5,  160,    540,     480,     120;
  6,  480,   3240,    5760,    3600,      720;
  7, 1344,  17010,   53760,   63000,    30240,    5040;
  8, 3584,  81648,  430080,  840000,   725760,  282240,   40320;
  9, 9216, 367416, 3096576, 9450000, 13063680, 8890560, 2903040, 362880;
		

Programs

  • Magma
    [Factorial(n)*k^(n-k)/Factorial(n-k): k in [1..n], n in [1..9]];  // Bruno Berselli, Nov 09 2011
    
  • Maple
    seq(seq(n!*k^(n-k)/(n-k)!, k=1..n), n=1..9);
  • Mathematica
    nn = 10; a = y x Exp[x]; f[list_] := Select[list, # > 0 &]; Drop[Map[f, Range[0, nn]! CoefficientList[Series[1/(1 - a) , {x, 0, nn}], {x, y}]], 1] // Flatten  (* Geoffrey Critzer, Jan 21 2012 *)
  • PARI
    T(n,k)=n!*k^(n-k)/(n-k)!;
    /* print triangle: */
    for (n=1, 15, for (k=1,n, print1(T(n,k),", ")); print() );
    /* Joerg Arndt, Sep 21 2012 */

Formula

T(n,k) = n!*k^(n-k)/(n-k)! = k!*k^(n-k)*binomial(n,k) for 1 <= k <= n.
E.g.f.: (x*e^x)^k,for fixed k.
T(n,k1+k2) = Sum_{j=0..n} binomial(n,j)*T(j,k1)*T(n-j,k2).
T(n,1) = A000027(n);
T(n,2) = A001815(n);
T(n,3) = A052791(n);
Sum_{k=1..n} T(n,k) = A006153(n).
T(n,n) = A000142(n) = n!. - Dennis P. Walsh, Sep 10 2012

A003013 E.g.f. 1 + x*exp(x) + x^2*exp(2*x).

Original entry on oeis.org

1, 1, 4, 15, 52, 165, 486, 1351, 3592, 9225, 23050, 56331, 135180, 319501, 745486, 1720335, 3932176, 8912913, 20054034, 44826643, 99614740, 220200981, 484442134, 1061158935, 2315255832, 5033164825
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    With[{nn=30},CoefficientList[Series[1+x Exp[x]+x^2 Exp[2x],{x,0,nn}],x] Range[0,nn]!] (* or *) Join[{1},LinearRecurrence[{8,-25,38,-28,8},{1,4,15,52,165},30]] (* Harvey P. Dale, Nov 01 2011 *)
  • PARI
    a(n)=([0,1,0,0,0; 0,0,1,0,0; 0,0,0,1,0; 0,0,0,0,1; 8,-28,38,-25,8]^n*[1;1;4;15;52])[1,1] \\ Charles R Greathouse IV, Jun 23 2020

Formula

From Ralf Stephan, Sep 02 2003: (Start)
a(0) = 1, a(n) = (n^2 - n)*2^n/4 + n.
a(n) = A002999(n) - n = A001815(n) + n. (End)
O.g.f.: 1+x*(-1+4*x-8*x^2+6*x^3) / ( (x-1)^2*(2*x-1)^3 ). - R. J. Mathar, Mar 22 2011
a(n) = 8*a(n-1) - 25*a(n-2) + 38*a(n-3) - 28*a(n-4) + 8*a(n-5); a(0)=1, a(1)=1, a(2)=4, a(3)=15, a(4)=52, a(5)=165. - Harvey P. Dale, Nov 01 2011

A144289 Triangle T(n,k), n >= 0, 0 <= k <= n, read by rows: Number T(n,k) of forests of labeled rooted trees on n or fewer nodes using a subset of labels 1..n and k edges.

Original entry on oeis.org

1, 2, 0, 4, 2, 0, 8, 12, 9, 0, 16, 48, 84, 64, 0, 32, 160, 480, 820, 625, 0, 64, 480, 2160, 6120, 10230, 7776, 0, 128, 1344, 8400, 34720, 94500, 155274, 117649, 0, 256, 3584, 29568, 165760, 647920, 1712592, 2776200, 2097152, 0, 512, 9216, 96768, 701568, 3669120, 13783392, 35630784, 57138120, 43046721, 0
Offset: 0

Views

Author

Alois P. Heinz, Sep 17 2008

Keywords

Examples

			T(3,1) = 12, because there are 12 forests of labeled rooted trees on 3 or fewer nodes using a subset of labels 1..3 and 1 edge:
  .1<2. .2<1. .1<3. .3<1. .2<3. .3<2. .1<2. .2<1. .1<3. .3<1. .2<3. .3<2.
  ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... .....
  ..... ..... ..... ..... ..... ..... .3... .3... .2... .2... .1... .1...
Triangle begins:
   1;
   2,   0;
   4,   2,   0;
   8,  12,   9,   0;
  16,  48,  84,  64,   0;
  32, 160, 480, 820, 625,  0;
		

Crossrefs

Columns 0, 1 give A000079, A001815.
First lower diagonal gives A000169 with first term 2.
Row sums give A088957.

Programs

  • Maple
    T:= proc(n,k) option remember;
          if k=0 then 2^n
        elif k<0 or n<=k then 0
        elif k=n-1 then n^(n-1)
        else add(binomial(n-1, j) *T(j+1, j) *T(n-1-j, k-j), j=0..k)
          fi
        end:
    seq(seq(T(n, k), k=0..n), n=0..11);
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k == 0, 2^n, k<0 || n <= k, 0, k == n-1, n^(n-1), True, Sum[Binomial[n-1, j]*T[j+1, j]*T[n-1-j, k-j], {j, 0, k}]]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 11}] // Flatten (* Jean-François Alcover, Jan 21 2014, translated from Alois P. Heinz's Maple code *)

Formula

T(n,0) = 2^n, T(n,k) = 0 if k < 0 or n <= k, otherwise T(n,k) = n^(n-1) if k=n-1, otherwise T(n,k) = Sum_{j=0..k} C(n-1,j)*T(j+1,j)*T(n-1-j,k-j).
Showing 1-10 of 21 results. Next