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 11 results. Next

A204064 G.f.: Sum_{n>=0} x^n * Product_{k=1..n} (k + n*x) / (1 + k*x + n*x^2).

Original entry on oeis.org

1, 1, 2, 5, 14, 44, 152, 572, 2324, 10124, 47012, 231572, 1204964, 6599444, 37924292, 228033332, 1431128804, 9354072404, 63548071172, 447923400692, 3270361265444, 24696229801364, 192625876675652, 1549890430643252, 12849460733123684, 109647468132256724
Offset: 0

Views

Author

Paul D. Hanna, Jan 09 2013

Keywords

Comments

Compare to the identity:
Sum_{n>=0} x^n * Product_{k=1..n} (k + x) / (1 + k*x + x^2) = (1+x^2)/(1-x).
Compare to the g.f. of A187741:
Sum_{n>=0} x^n * (1 + n*x)^n / (1 + x + n*x^2)^n = 1/2 + (1+2*x)*Sum_{n>=0} (n+1)!*x^(2*n)/2.

Examples

			G.f.: A(x) = 1 + x + 2*x^2 + 5*x^3 + 14*x^4 + 44*x^5 + 152*x^6 + 572*x^7 +...
where
A(x) = 1 + x*(1+x)/(1+x+x^2) + x^2*(1+2*x)*(2+2*x)/((1+x+2*x^2)*(1+2*x+2*x^2)) + x^3*(1+3*x)*(2+3*x)*(3+3*x)/((1+x+3*x^2)*(1+2*x+3*x^2)*(1+3*x+3*x^2)) + x^4*(1+4*x)*(2+4*x)*(3+4*x)*(4+4*x)/((1+x+4*x^2)*(1+2*x+4*x^2)*(1+3*x+4*x^2)*(1+4*x+4*x^2)) +...
Also, we have the identity (cf. A229046):
A(x) = 1/2 + (1/2)*(1+x)/(1+x) + (2!/2)*x*(1+x)^2/((1+x)*(1+2*x)) + (3!/2)*x^2*(1+x)^3/((1+x)*(1+2*x)*(1+3*x)) + (4!/2)*x^3*(1+x)^4/((1+x)*(1+2*x)*(1+3*x)*(1+4*x)) + (5!/2)*x^4*(1+x)^5/((1+x)*(1+2*x)*(1+3*x)*(1+4*x)*(1+5*x)) +...
		

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(n<1, 1, `if`(k>
          ceil(n/2), 0, add((k-j)*b(n-1-j, k-j), j=0..1)))
        end:
    a:= n-> ceil(add(b(n+2, k), k=1..1+ceil(n/2))/2):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 26 2018
  • Mathematica
    b[n_, k_] := b[n, k] = If[n < 1, 1, If[k > Ceiling[n/2], 0, Sum[(k - j) b[n - 1 - j, k - j], {j, 0, 1}]]];
    a[n_] := Ceiling[Sum[b[n + 2, k], {k, 1, 1 + Ceiling[n/2]}]/2];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jun 05 2018, after Alois P. Heinz *)
  • PARI
    {a(n)=polcoeff( sum(m=0, n, x^m*prod(k=1,m,(k+m*x)/(1+k*x+m*x^2 +x*O(x^n))) ), n)}
    for(n=0, 30, print1(a(n), ", "))
    
  • PARI
    {a(n)=polcoeff( 1/2 + sum(m=1, n+1, m!/2*x^(m-1)*(1+x)^m/prod(k=1, m, 1+k*x +x*O(x^n))), n)}
    for(n=0,30,print1(a(n),", "))
    
  • PARI
    {a(n)=if(n<0,0,if(n<1,1,(1/2)*sum(k=0, floor((n+1)/2), sum(i=0, k, (-1)^i*binomial(k, i)*(k-i+1)^(n-k+1)))))} \\ Paul D. Hanna, Jul 13 2014
    for(n=0, 30, print1(a(n), ", "))

Formula

G.f.: 1/2 + Sum_{n>=1} n!/2 * x^(n-1) * (1+x)^n / Product_{k=1..n} (1 + k*x). - Paul D. Hanna, Oct 27 2013
a(n) = A229046(n+1)/2 for n>0.
a(n) = (1/2)*Sum_{k=0..floor((n+1)/2)} Sum_{i=0..k} (-1)^i * C(k,i) * (k-i+1)^(n-k+1) for n>1. (See Paul Barry's formula in A105795). - Paul D. Hanna, Jul 13 2014

A105795 Shallow diagonal sums of the triangle k!*Stirling2(n,k): a(n) = Sum_{k=0..floor(n/2)} T(n-k,k) where T is A019538.

Original entry on oeis.org

1, 0, 1, 1, 3, 7, 21, 67, 237, 907, 3741, 16507, 77517, 385627, 2024301, 11174587, 64673997, 391392667, 2470864941, 16237279867, 110858862477, 784987938907, 5755734591981, 43636725010747, 341615028340557, 2758165832945947, 22940755633301421, 196354180631212027
Offset: 0

Views

Author

Paul Barry, Apr 20 2005

Keywords

Comments

From Gus Wiseman, Jan 08 2019: (Start)
Also the number of set partitions of {1,...,n} into blocks of sizes > 1 whose minima form an initial interval of positive integers. For example, the a(5) = 7 set partitions are:
{{1,2,3,4,5}}
{{1,3},{2,4,5}}
{{1,4},{2,3,5}}
{{1,5},{2,3,4}}
{{1,3,4},{2,5}}
{{1,3,5},{2,4}}
{{1,4,5},{2,3}}
Also the number of ordered set partitions of {1,...,n-k} of length k, for any 0 <= k <= n. For example, the a(5) = 7 ordered set partitions are:
{{1,2,3,4}}
{{1},{2,3}}
{{2},{1,3}}
{{3},{1,2}}
{{1,2},{3}}
{{1,3},{2}}
{{2,3},{1}}
(End)

Examples

			a(8) = 1!*Stirling2(7,1) + 2!*Stirling2(6,2) + 3!*Stirling2(5,3) + 4!*Stirling2(4,4) = 1 + 62 + 150 + 24 = 237. - _Peter Bala_, Jul 09 2014
		

Crossrefs

Programs

  • Maple
    a:= n-> add(Stirling2(n-k, k)*k!, k=0..n/2):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jul 09 2014
  • Mathematica
    Table[Sum[StirlingS2[n-k, k]*k!, {k,0,n/2}],{n,0,20}] (* Vaclav Kotesovec, Jul 16 2014 *)
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Sum[Length[Join@@Permutations/@Select[sps[Range[n-k]],Length[#]==k&]],{k,0,n}],{n,0,10}] (* Gus Wiseman, Jan 08 2019 *)
  • PARI
    /* From Paul Barry's formula: */
    {a(n)=sum(k=0,floor(n/2), sum(i=0,k,(-1)^i*binomial(k, i)*(k-i)^(n-k)))} \\ Paul D. Hanna, Dec 28 2013
    for(n=0,30,print1(a(n),", "))
    
  • PARI
    /* From e.g.f. series involving iterated integration: */
    {INTEGRATE(n,F)=local(G=F);for(i=1,n,G=intformal(G));G}
    {a(n)=local(A=1+x);A=1+sum(k=1,n,INTEGRATE(k,(exp(x+x*O(x^n))-1)^k ));n!*polcoeff(A,n)} \\ Paul D. Hanna, Dec 28 2013

Formula

a(n) = sum{k=0..floor(n/2), sum{(-1)^i*binomial(k, i)*(k-i)^(n-k)}}.
E.g.f.: Sum_{n>=0} Integral^n (exp(x) - 1)^n dx^n, where integral^n F(x) dx^n is the n-th integration of F(x) with no constant of integration. - Paul D. Hanna, Dec 28 2013
Formal o.g.f.: 1/(1 + x)*sum {n >= 0} 1/(1 - n*x)*(x/(1 + x))^n = 1 + x^2 + x^3 + 3*x^4 + 7*x^5 + .... Cf. A229046. - Peter Bala, Jul 09 2014

A112532 First differences of [0, A047970].

Original entry on oeis.org

1, 1, 3, 9, 29, 101, 379, 1525, 6549, 29889, 144419, 736241, 3947725, 22201549, 130624587, 802180701, 5131183301, 34121977865, 235486915507, 1683925343929, 12458499203901, 95237603403381, 751291094637083, 6108883628141189, 51144808472958709, 440444879385258001
Offset: 0

Views

Author

Alford Arnold, Sep 10 2005

Keywords

Comments

Number of sequences of length n in [n] (endofunctions) whose first run has length equal to the maximum of the sequence.

Examples

			The 9 sequences for n=4 (sorted by maximum)
1121,1122,2211,2212, 1113,2223,3331,3332, 4444
The 29 sequences for n=5 (sorted by maximum)
11211,11212,11221,11222, 22111,22112,22121,22122, 11123,11131,11132,11133, 22213,22231,22232,22233, 33311,33312,33313,33321,33322,33323, 11114, 22224, 33334, 44441,44442,44443, 55555
		

Crossrefs

First differences of column 0 of triangle A089246 (beginning at row 1). With offset 1, first differences of column 0 of triangle A242431. Second differences of column 0 of triangle A101494.

Programs

  • Mathematica
    a[n_]:= If[n==0, 1, n + Sum[(i-1)^2*i^(n-i), {i,0,n}]];
    Table[a[n], {n, 0, 30}] (* G. C. Greubel, Jan 12 2022 *)
  • PARI
    a(n) = n + sum(i = 0, n, (n-i-1)^2 * (n-i)^i); \\ Michel Marcus, Mar 01 2021
    
  • Sage
    [n +sum((j-1)^2*j^(n-j) for j in (0..n)) for n in (0..30)] # G. C. Greubel, Jan 12 2022

Formula

G.f.: (1-x)^2*( Sum_{n >= 0} x^n/(1 - (n+2)*x) ). - Peter Bala, Jul 09 2014
From Mathew Englander, Feb 28 2021: (Start)
a(n) = A089246(n+2,0) - A089246(n+1,0).
a(n) = n + Sum_{i = 0..n} (n-i-1)^2 * (n-i)^i. (End)

Extensions

Corrected by D. S. McNeil, Aug 20 2010
Combinatorial interpretation and examples by Olivier Gérard, Jan 29 2023

A245373 G.f.: Sum_{n>=0} x^n / ( (1+x)^(n+1) * (1 - 2*(n+1)*x) ).

Original entry on oeis.org

1, 2, 6, 20, 80, 368, 1904, 10880, 67904, 459008, 3336704, 25925120, 214175744, 1873092608, 17276401664, 167504076800, 1702214549504, 18084149854208, 200388963958784, 2311212530401280, 27693720143396864, 344157474490155008, 4428851361694613504, 58933575269230837760
Offset: 0

Views

Author

Paul D. Hanna, Jul 19 2014

Keywords

Comments

A generalization of Peter Bala's formula in A229046 is as follows:
if F(x,y) = Sum_{n>=0} x^n / ( (1+x)^(n+1) * (1 - (n+1)*x*y) ) then
F(x,y) = Sum_{n>=0} n! * (x*y)^n * (1+x)^n / Product_{k=1..n} (1 + k*x*y);
further, F(x,y) = Sum_{n>=0} b(n,y)*x^n where b(n,y) is given by
b(n,y) = Sum_{k=0..floor(n/2)} Sum_{i=0..k} (-1)^i * C(k,i) * (k-i+1)^(n-k) * y^(n-k).

Examples

			G.f.: A(x) = 1 + 2*x + 6*x^2 + 20*x^3 + 80*x^4 + 368*x^5 + 1904*x^6 +...
where we have the following series identity:
A(x) = 1/((1+x)*(1-2*x)) + x/((1+x)^2*(1-4*x)) + x^2/((1+x)^3*(1-6*x))+ x^3/((1+x)^4*(1-8*x))+ x^4/((1+x)^5*(1-10*x)) + x^5/((1+x)^6*(1-12*x)) +...
is equal to
A(x) = 1 + 2*x*(1+x)/(1+2*x) + 2!*(2*x)^2*(1+x)^2/((1+2*x)*(1+4*x)) + 3!*(2*x)^3*(1+x)^3/((1+2*x)*(1+4*x)*(1+6*x)) + 4!*(2*x)^4*(1+x)^4/((1+2*x)*(1+4*x)*(1+6*x)*(1+8*x)) + 5!*(2*x)^5*(1+x)^5/((1+2*x)*(1+4*x)*(1+6*x)*(1+8*x)*(1+10*x)) +...
		

Crossrefs

Programs

  • PARI
    {a(n)=polcoeff( sum(m=0, n, x^m/((1+x)^(m+1)*(1 - 2*(m+1)*x) +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))
    
  • PARI
    {a(n)=polcoeff( sum(m=0, n, 2^m*m!*x^m*(1+x)^m/prod(k=1, m, 1+2*k*x +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))
    
  • PARI
    {a(n)=sum(k=0, floor(n/2), sum(i=0, k, (-1)^i*binomial(k, i)*(k-i+1)^(n-k)*2^(n-k)))}
    for(n=0, 30, print1(a(n), ", "))

Formula

G.f.: Sum_{n>=0} n! * (2*x)^n * (1+x)^n / Product_{k=1..n} (1 + 2*k*x).
a(n) = Sum_{k=0..floor(n/2)} Sum_{i=0..k} (-1)^i * binomial(k,i) * 2^(n-k) * (k-i+1)^(n-k).

A245374 G.f.: Sum_{n>=0} x^n / ( (1+x)^(n+1) * (1 - 3*(n+1)*x) ).

Original entry on oeis.org

1, 3, 12, 54, 288, 1782, 12474, 96714, 819882, 7536402, 74610234, 790692354, 8921660922, 106687646802, 1346863560714, 17890362862434, 249297686894682, 3634756665823602, 55317506662094634, 876911386062810114, 14451743847813157242, 247171758180997987602, 4380263376360686471754
Offset: 0

Views

Author

Paul D. Hanna, Jul 19 2014

Keywords

Examples

			G.f.: A(x) = 1 + 3*x + 12*x^2 + 54*x^3 + 288*x^4 + 1782*x^5 + 12474*x^6 +...
where we have the following series identity:
A(x) = 1/((1+x)*(1-3*x)) + x/((1+x)^2*(1-6*x)) + x^2/((1+x)^3*(1-9*x))+ x^3/((1+x)^4*(1-12*x))+ x^4/((1+x)^5*(1-15*x)) + x^5/((1+x)^6*(1-18*x)) +...
is equal to
A(x) = 1 + 3*x*(1+x)/(1+3*x) + 2!*(3*x)^2*(1+x)^2/((1+3*x)*(1+6*x)) + 3!*(3*x)^3*(1+x)^3/((1+3*x)*(1+6*x)*(1+9*x)) + 4!*(3*x)^4*(1+x)^4/((1+3*x)*(1+6*x)*(1+9*x)*(1+12*x)) + 5!*(3*x)^5*(1+x)^5/((1+3*x)*(1+6*x)*(1+9*x)*(1+12*x)*(1+15*x)) +...
		

Crossrefs

Programs

  • PARI
    {a(n)=polcoeff( sum(m=0, n, x^m/((1+x)^(m+1)*(1 - 3*(m+1)*x) +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))
    
  • PARI
    {a(n)=polcoeff( sum(m=0, n, 3^m*m!*x^m*(1+x)^m/prod(k=1, m, 1+3*k*x +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))
    
  • PARI
    {a(n)=sum(k=0, floor(n/2), sum(i=0, k, (-1)^i*binomial(k, i)*(k-i+1)^(n-k)*3^(n-k)))}
    for(n=0, 30, print1(a(n), ", "))

Formula

G.f.: Sum_{n>=0} n! * (3*x)^n * (1+x)^n / Product_{k=1..n} (1 + 3*k*x).
a(n) = Sum_{k=0..floor(n/2)} Sum_{i=0..k} (-1)^i * binomial(k,i) * 3^(n-k) * (k-i+1)^(n-k).

A245375 G.f.: Sum_{n>=0} x^n / ( (1+x)^(n+1) * (1 - 4*(n+1)*x) ).

Original entry on oeis.org

1, 4, 20, 112, 736, 5632, 49024, 474112, 5017600, 57597952, 712597504, 9446981632, 133474877440, 2000265674752, 31666683510784, 527786775150592, 9233419259084800, 169106747636580352, 3234542505882025984, 64473076850860490752, 1336621867385969704960, 28769619371258703511552
Offset: 0

Views

Author

Paul D. Hanna, Jul 19 2014

Keywords

Examples

			G.f.: A(x) = 1 + 4*x + 20*x^2 + 112*x^3 + 736*x^4 + 5632*x^5 + 49024*x^6 +...
where we have the following series identity:
A(x) = 1/((1+x)*(1-4*x)) + x/((1+x)^2*(1-8*x)) + x^2/((1+x)^3*(1-12*x))+ x^3/((1+x)^4*(1-16*x))+ x^4/((1+x)^5*(1-20*x)) + x^5/((1+x)^6*(1-24*x)) +...
is equal to
A(x) = 1 + 4*x*(1+x)/(1+4*x) + 2!*(4*x)^2*(1+x)^2/((1+4*x)*(1+8*x)) + 3!*(4*x)^3*(1+x)^3/((1+4*x)*(1+8*x)*(1+12*x)) + 4!*(4*x)^4*(1+x)^4/((1+4*x)*(1+8*x)*(1+12*x)*(1+16*x)) + 5!*(4*x)^5*(1+x)^5/((1+4*x)*(1+8*x)*(1+12*x)*(1+16*x)*(1+20*x)) +...
		

Crossrefs

Programs

  • PARI
    {a(n)=polcoeff( sum(m=0, n, x^m/((1+x)^(m+1)*(1 - 4*(m+1)*x) +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))
    
  • PARI
    {a(n)=polcoeff( sum(m=0, n, 4^m*m!*x^m*(1+x)^m/prod(k=1, m, 1+4*k*x +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))
    
  • PARI
    {a(n)=sum(k=0, floor(n/2), sum(i=0, k, (-1)^i*binomial(k, i)*(k-i+1)^(n-k)*4^(n-k)))}
    for(n=0, 30, print1(a(n), ", "))

Formula

G.f.: Sum_{n>=0} n! * (4*x)^n * (1+x)^n / Product_{k=1..n} (1 + 4*k*x).
a(n) = Sum_{k=0..floor(n/2)} Sum_{i=0..k} (-1)^i * binomial(k,i) * 4^(n-k) * (k-i+1)^(n-k).

A245376 G.f.: Sum_{n>=0} x^n / ( (1+x)^(n+1) * (1 - 5*(n+1)*x) ).

Original entry on oeis.org

1, 5, 30, 200, 1550, 14000, 144500, 1662500, 20952500, 286437500, 4221312500, 66703437500, 1124194062500, 20109785937500, 380209901562500, 7571141773437500, 158312671414062500, 3466819503710937500, 79316483272226562500, 1891747084452148437500, 46942864023040039062500
Offset: 0

Views

Author

Paul D. Hanna, Jul 19 2014

Keywords

Examples

			G.f.: A(x) = 1 + 5*x + 30*x^2 + 200*x^3 + 1550*x^4 + 14000*x^5 +...
where we have the following series identity:
A(x) = 1/((1+x)*(1-5*x)) + x/((1+x)^2*(1-10*x)) + x^2/((1+x)^3*(1-15*x))+ x^3/((1+x)^4*(1-20*x))+ x^4/((1+x)^5*(1-25*x)) + x^5/((1+x)^6*(1-30*x)) +...
is equal to
A(x) = 1 + 5*x*(1+x)/(1+5*x) + 2!*(5*x)^2*(1+x)^2/((1+5*x)*(1+10*x)) + 3!*(5*x)^3*(1+x)^3/((1+5*x)*(1+10*x)*(1+15*x)) + 4!*(5*x)^4*(1+x)^4/((1+5*x)*(1+10*x)*(1+15*x)*(1+20*x)) + 5!*(5*x)^5*(1+x)^5/((1+5*x)*(1+10*x)*(1+15*x)*(1+20*x)*(1+25*x)) +...
		

Crossrefs

Programs

  • PARI
    {a(n)=polcoeff( sum(m=0, n, x^m/((1+x)^(m+1)*(1 - 5*(m+1)*x) +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))
    
  • PARI
    {a(n)=polcoeff( sum(m=0, n, 5^m*m!*x^m*(1+x)^m/prod(k=1, m, 1+5*k*x +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))
    
  • PARI
    {a(n)=sum(k=0, floor(n/2), sum(i=0, k, (-1)^i*binomial(k, i)*(k-i+1)^(n-k)*5^(n-k)))}
    for(n=0, 30, print1(a(n), ", "))

Formula

G.f.: Sum_{n>=0} n! * (5*x)^n * (1+x)^n / Product_{k=1..n} (1 + 5*k*x).
a(n) = Sum_{k=0..floor(n/2)} Sum_{i=0..k} (-1)^i * binomial(k,i) * 5^(n-k) * (k-i+1)^(n-k).

A245156 G.f.: Sum_{n>=0} x^n/((1+x)^(2*n)*(1 - (2*n)*x)).

Original entry on oeis.org

1, 1, 1, 4, 13, 51, 234, 1205, 6861, 42696, 287893, 2088343, 16195822, 133582909, 1166593665, 10746339324, 104072482781, 1056515903547, 11213782563474, 124152537651877, 1430804512710901, 17131971790847440, 212761333257548485, 2736258689605227615, 36389676240341831766
Offset: 0

Views

Author

Paul D. Hanna, Jul 15 2014

Keywords

Comments

Inspired by Peter Bala's formula in A229046.

Examples

			G.f.: A(x) = 1 + x + x^2 + 4*x^3 + 13*x^4 + 51*x^5 + 234*x^6 +...
where
A(x) = 1 + x/((1+x)^2*(1-2*x)) + x^2/((1+x)^4*(1-4*x)) + x^3/((1+x)^6*(1-6*x))+ x^4/((1+x)^8*(1-8*x))+ x^5/((1+x)^10*(1-10*x)) + x^6/((1+x)^12*(1-12*x)) +...
		

Crossrefs

Programs

  • PARI
    {a(n)=polcoeff( sum(m=0, n, x^m/((1+x)^(2*m)*(1 - 2*m*x) +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))

A245157 G.f.: Sum_{n>=0} x^n/((1+x)^(2*n+1)*(1 - (2*n+1)*x)).

Original entry on oeis.org

1, 1, 2, 7, 25, 108, 525, 2841, 16926, 109795, 768721, 5769848, 46170841, 392042257, 3517885530, 33240220095, 329703176361, 3423448119588, 37121182883557, 419414109036649, 4927952017449398, 60105139223521051, 759744837538329121, 9937680363610804080, 134328047043765078705
Offset: 0

Views

Author

Paul D. Hanna, Jul 15 2014

Keywords

Comments

Inspired by Peter Bala's formula in A229046.

Examples

			G.f.: A(x) = 1 + x + 2*x^2 + 7*x^3 + 25*x^4 + 108*x^5 + 525*x^6 +...
where
A(x) = 1/((1+x)*(1-x)) + x/((1+x)^3*(1-3*x)) + x^2/((1+x)^5*(1-5*x))+ x^3/((1+x)^7*(1-7*x))+ x^4/((1+x)^9*(1-9*x)) + x^5/((1+x)^11*(1-11*x)) +...
		

Crossrefs

Programs

  • PARI
    {a(n)=polcoeff( sum(m=0, n, x^m/((1+x)^(2*m+1)*(1 - (2*m+1)*x) +x*O(x^n))), n)}
    for(n=0, 30, print1(a(n), ", "))

A298668 Number T(n,k) of set partitions of [n] into k blocks such that the absolute difference between least elements of consecutive blocks is always > 1; triangle T(n,k), n>=0, 0<=k<=ceiling(n/2), read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 3, 0, 1, 7, 2, 0, 1, 15, 12, 0, 1, 31, 50, 6, 0, 1, 63, 180, 60, 0, 1, 127, 602, 390, 24, 0, 1, 255, 1932, 2100, 360, 0, 1, 511, 6050, 10206, 3360, 120, 0, 1, 1023, 18660, 46620, 25200, 2520, 0, 1, 2047, 57002, 204630, 166824, 31920, 720
Offset: 0

Views

Author

Alois P. Heinz, Jan 24 2018

Keywords

Examples

			T(5,1) = 1: 12345.
T(5,2) = 7: 1234|5, 1235|4, 123|45, 1245|3, 124|35, 125|34, 12|345.
T(5,3) = 2: 124|3|5, 12|34|5.
T(7,4) = 6: 1246|3|5|7, 124|36|5|7, 124|3|56|7, 126|34|5|7, 12|346|5|7, 12|34|56|7.
T(9,5) = 24: 12468|3|5|7|9, 1246|38|5|7|9, 1246|3|58|7|9, 1246|3|5|78|9, 1248|36|5|7|9, 124|368|5|7|9, 124|36|58|7|9, 124|36|5|78|9, 1248|3|56|7|9, 124|38|56|7|9, 124|3|568|7|9, 124|3|56|78|9, 1268|34|5|7|9, 126|348|5|7|9, 126|34|58|7|9, 126|34|5|78|9, 128|346|5|7|9, 12|3468|5|7|9, 12|346|58|7|9, 12|346|5|78|9, 128|34|56|7|9, 12|348|56|7|9, 12|34|568|7|9, 12|34|56|78|9.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1;
  0, 1,    1;
  0, 1,    3;
  0, 1,    7,     2;
  0, 1,   15,    12;
  0, 1,   31,    50,     6;
  0, 1,   63,   180,    60;
  0, 1,  127,   602,   390,    24;
  0, 1,  255,  1932,  2100,   360;
  0, 1,  511,  6050, 10206,  3360,  120;
  0, 1, 1023, 18660, 46620, 25200, 2520;
  ...
		

Crossrefs

Columns k=0-11 give (offsets may differ): A000007, A057427, A168604, A028243, A028244, A028245, A032180, A228909, A228910, A228911, A228912, A228913.
Row sums give A229046(n-1) for n>0.
T(2n+1,n+1) gives A000142.
T(2n,n) gives A001710(n+1).

Programs

  • Maple
    b:= proc(n, m, t) option remember; `if`(n=0, x^m, add(
          b(n-1, max(m, j), `if`(j>m, 1, 0)), j=1..m+1-t))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
    seq(T(n), n=0..14);
    # second Maple program:
    T:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), (k-1)!*Stirling2(n-k+1, k)):
    seq(seq(T(n, k), k=0..ceil(n/2)), n=0..14);
    # third Maple program:
    T:= proc(n, k) option remember; `if`(k<2, `if`(n=0 xor k=0, 0, 1),
          `if`(k>ceil(n/2), 0, add((k-j)*T(n-1-j, k-j), j=0..1)))
        end:
    seq(seq(T(n, k), k=0..ceil(n/2)), n=0..14);
  • Mathematica
    T[n_, k_] := T[n, k] = If[k < 2, If[Xor[n == 0, k == 0], 0, 1],
         If[k > Ceiling[n/2], 0, Sum[(k-j) T[n-1-j, k-j], {j, 0, 1}]]];
    Table[Table[T[n, k], {k, 0, Ceiling[n/2]}], {n, 0, 14}] // Flatten (* Jean-François Alcover, Mar 08 2021, after third Maple program *)

Formula

T(n,k) = (k-1)! * Stirling2(n-k+1,k) for k>0, T(n,0) = A000007(n).
T(n,k) = Sum_{j=0..k-1} (-1)^j*C(k-1,j)*(k-j)^(n-k) for k>0, T(n,0) = A000007(n).
T(n,k) = (k-1)! * A136011(n,k) for n, k >= 1.
Sum_{j>=0} T(n+j,j) = A076726(n) = 2*A000670(n) = A000629(n) + A000007(n).
Showing 1-10 of 11 results. Next