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.

A362926 Triangle read by rows: A113547 without its main diagonal.

Original entry on oeis.org

1, 1, 2, 1, 4, 5, 1, 8, 13, 15, 1, 16, 35, 47, 52, 1, 32, 97, 153, 188, 203, 1, 64, 275, 515, 706, 825, 877, 1, 128, 793, 1785, 2744, 3479, 3937, 4140, 1, 256, 2315, 6347, 11002, 15177, 18313, 20270, 21147, 1, 512, 6817, 23073, 45368, 68303, 88033, 102678, 111835, 115975, 1, 1024, 20195, 85475, 191866, 316305, 436297, 536882, 610989, 657423, 678570
Offset: 1

Views

Author

N. J. A. Sloane, Aug 11 2023, based on an email from Don Knuth

Keywords

Comments

A variant of A113547 and A362924. See those entries for further information.

Examples

			Triangle begins:
  [1],
  [1, 2],
  [1, 4, 5],
  [1, 8, 13, 15],
  [1, 16, 35, 47, 52],
  [1, 32, 97, 153, 188, 203],
  [1, 64, 275, 515, 706, 825, 877],
  [1, 128, 793, 1785, 2744, 3479, 3937, 4140],
  [1, 256, 2315, 6347, 11002, 15177, 18313, 20270, 21147],
  ...
		

Crossrefs

Programs

  • Mathematica
    A362926[n_,m_]:=Sum[StirlingS2[m-1,k-1]k^(n-m+1),{k,m}];
    Table[A362926[n,m],{n,15},{m,n}] (* Paolo Xausa, Dec 02 2023 *)

Extensions

Name corrected by Paolo Xausa, Dec 02 2023

A271466 Number T(n,k) of set partitions of [n] such that k is the largest element of the last block; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 2, 0, 1, 4, 0, 1, 4, 10, 0, 1, 6, 15, 30, 0, 1, 10, 29, 59, 104, 0, 1, 18, 63, 139, 250, 406, 0, 1, 34, 149, 365, 692, 1145, 1754, 0, 1, 66, 375, 1039, 2110, 3627, 5649, 8280, 0, 1, 130, 989, 3149, 6932, 12521, 20085, 29874, 42294, 0, 1, 258, 2703, 10039, 24190, 46299, 77133, 117488, 168509, 231950
Offset: 1

Views

Author

Alois P. Heinz, Apr 08 2016

Keywords

Comments

Each set partition is written as a sequence of blocks, ordered by the smallest elements in the blocks.

Examples

			T(1,1) = 1: 1.
T(2,2) = 2: 12, 1|2.
T(3,2) = 1: 13|2.
T(3,3) = 4: 123, 12|3, 1|23, 1|2|3.
T(4,2) = 1: 134|2.
T(4,3) = 4: 124|3, 14|23, 14|2|3, 1|24|3.
T(4,4) = 10: 1234, 123|4, 12|34, 12|3|4, 13|24, 13|2|4, 1|234, 1|23|4, 1|2|34, 1|2|3|4.
T(5,2) = 1: 1345|2.
T(5,3) = 6: 1245|3, 145|23, 145|2|3, 14|25|3, 15|24|3, 1|245|3.
T(5,4) = 15: 1235|4, 125|34, 125|3|4, 12|35|4, 135|24, 135|2|4, 13|25|4, 15|234, 15|23|4, 1|235|4, 15|2|34, 1|25|34, 15|2|3|4, 1|25|3|4, 1|2|35|4.
Triangle T(n,k) begins:
  1;
  0, 2;
  0, 1,   4;
  0, 1,   4,  10;
  0, 1,   6,  15,   30;
  0, 1,  10,  29,   59,  104;
  0, 1,  18,  63,  139,  250,   406;
  0, 1,  34, 149,  365,  692,  1145,  1754;
  0, 1,  66, 375, 1039, 2110,  3627,  5649,  8280;
  0, 1, 130, 989, 3149, 6932, 12521, 20085, 29874, 42294;
  ...
		

Crossrefs

Columns k=1-10 give: A000007(n-1), A054977(n-2), A052548(n-3) for n>3, A271743, A271744, A271745, A271746, A271747, A271748, A271749.
Main diagonal gives A186021(n-1).
Lower diagonals d=1-10 give: A271752, A271753, A271754, A271755, A271756, A271757, A271758, A271759, A271760, A271761.
Row sums give A000110.
T(2n,n) gives A271467.
T(2n+1,n+1) gives A271607.
Cf. A095149 (k is maximum of the first block), A113547 (k is minimum of the last block).

Programs

  • Maple
    b:= proc(n, m, c) option remember; `if`(n=0, x^c, add(
          b(n-1, max(m, j), `if`(j>=m, n, c)), j=1..m+1))
        end:
    T:= n-> (p-> seq(coeff(p, x, n-i), i=0..n-1))(b(n, 0$2)):
    seq(T(n), n=1..12);
  • Mathematica
    b[n_, m_, c_] := b[n, m, c] = If[n == 0, x^c, Sum[b[n-1, Max[m, j], If[j >= m, n, c]], {j, 1, m+1}]];
    T[n_] := Function[p, Table[Coefficient[p, x, n-i], {i, 0, n-1}]][b[n, 0, 0]];
    Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Apr 24 2016, translated from Maple *)

Formula

T(n,n) = 2 * A000110(n-1) = 2 * Sum_{j=0..n-1} T(n-1,j) for n>1.

A340598 Number of balanced set partitions of {1..n}.

Original entry on oeis.org

0, 1, 0, 3, 3, 10, 60, 210, 700, 3556, 19845, 105567, 550935, 3120832, 19432413, 127949250, 858963105, 5882733142, 41636699676, 307105857344, 2357523511200, 18694832699907, 152228641035471, 1270386473853510, 10872532998387918, 95531590347525151
Offset: 0

Views

Author

Gus Wiseman, Jan 20 2021

Keywords

Comments

A set partition is balanced if it has exactly as many blocks as the greatest size of a block.

Examples

			The a(1) = 1 through a(5) = 10 balanced set partitions (empty column indicated by dot):
  {{1}}  .  {{1},{2,3}}  {{1,2},{3,4}}  {{1},{2},{3,4,5}}
            {{1,2},{3}}  {{1,3},{2,4}}  {{1},{2,3,4},{5}}
            {{1,3},{2}}  {{1,4},{2,3}}  {{1,2,3},{4},{5}}
                                        {{1},{2,3,5},{4}}
                                        {{1,2,4},{3},{5}}
                                        {{1},{2,4,5},{3}}
                                        {{1,2,5},{3},{4}}
                                        {{1,3,4},{2},{5}}
                                        {{1,3,5},{2},{4}}
                                        {{1,4,5},{2},{3}}
		

Crossrefs

The unlabeled version is A047993 (A106529).
A000110 counts set partitions.
A000670 counts ordered set partitions.
A113547 counts set partitions by maximin.
Other balance-related sequences:
- A010054 counts balanced strict integer partitions (A002110).
- A098124 counts balanced integer compositions.
- A340596 counts co-balanced factorizations.
- A340599 counts alt-balanced factorizations.
- A340600 counts unlabeled balanced multiset partitions.
- A340653 counts balanced factorizations.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[Range[n]],Length[#]==Max@@Length/@#&]],{n,0,8}]
  • PARI
    \\ D(n,k) counts balanced set partitions with k blocks.
    D(n,k)={my(t=sum(i=1, k, x^i/i!) + O(x*x^n)); n!*polcoef(t^k - (t-x^k/k!)^k, n)/k!}
    a(n)={sum(k=sqrtint(n), (n+1)\2, D(n,k))} \\ Andrew Howroyd, Mar 14 2021

Extensions

Terms a(12) and beyond from Andrew Howroyd, Mar 14 2021

A362925 Triangle read by rows: T(n,m), n >= 0, 0 <= m <= n, is number of partitions of the set {1,2,...,n} that have at most one block contained in {1,...,m}.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 5, 5, 4, 1, 15, 15, 13, 8, 1, 52, 52, 47, 35, 16, 1, 203, 203, 188, 153, 97, 32, 1, 877, 877, 825, 706, 515, 275, 64, 1, 4140, 4140, 3937, 3479, 2744, 1785, 793, 128, 1, 21147, 21147, 20270, 18313, 15177, 11002, 6347, 2315, 256, 1, 115975, 115975, 111835, 102678, 88033, 68303, 45368, 23073, 6817, 512, 1
Offset: 0

Views

Author

N. J. A. Sloane, Aug 10 2023, based on an email from Don Knuth

Keywords

Comments

A variant of A113547 and A362924. See those entries for further information.

Examples

			Triangle begins:
       1;
       1,      1;
       2,      2,      1;
       5,      5,      4,      1;
      15,     15,     13,      8,     1;
      52,     52,     47,     35,    16,     1;
     203,    203,    188,    153,    97,    32,     1;
     877,    877,    825,    706,   515,   275,    64,     1;
    4140,   4140,   3937,   3479,  2744,  1785,   793,   128,    1;
   21147,  21147,  20270,  18313, 15177, 11002,  6347,  2315,  256,   1;
  115975, 115975, 111835, 102678, 88033, 68303, 45368, 23073, 6817, 512, 1;
  ...
		

Crossrefs

Row sums are A000110(n+1).
Columns k=0+1,2-5 give A000110, A078468(n-2) (for n>=2), A383052(n-3) (for n>=3), A383053(n-4) (for n>=4), A383054(n-5) (for n>=5).
T(n+j,n) give (for j=0-2): A000012, A000079, A007689.
T(2n,n) gives A367820.

Programs

  • Maple
    T:= (n, k)-> add(Stirling2(n-k, j)*(j+1)^k, j=0..n-k):
    seq(seq(T(n, k), k=0..n), n=0..10);  # Alois P. Heinz, Dec 01 2023
  • Mathematica
    A362925[n_, m_]:=Sum[StirlingS2[n-m,k](k+1)^m,{k,0,n-m}];
    Table[A362925[n,m],{n,0,15},{m,0,n}] (* Paolo Xausa, Dec 04 2023 *)

Formula

Sum_{k=0..n} (k+1) * T(n,k) = A040027(n+1). - Alois P. Heinz, Dec 02 2023

A362924 Triangle read by rows: T(n,m), n >= 1, 1 <= m <= n, is number of partitions of the set {1,2,...,n} that have at most one block contained in {1,...,m}.

Original entry on oeis.org

1, 2, 1, 5, 4, 1, 15, 13, 8, 1, 52, 47, 35, 16, 1, 203, 188, 153, 97, 32, 1, 877, 825, 706, 515, 275, 64, 1, 4140, 3937, 3479, 2744, 1785, 793, 128, 1, 21147, 20270, 18313, 15177, 11002, 6347, 2315, 256, 1, 115975, 111835, 102678, 88033, 68303, 45368, 23073, 6817, 512, 1, 678570, 657423, 610989, 536882, 436297, 316305, 191866, 85475, 20195, 1024, 1
Offset: 1

Views

Author

N. J. A. Sloane, Aug 10 2023, based on an email from Don Knuth

Keywords

Comments

Also, the maximum number of solutions to an exact cover problem with n items, of which m are secondary.

Examples

			Triangle begins:
  [1],
  [2, 1],
  [5, 4, 1],
  [15, 13, 8, 1],
  [52, 47, 35, 16, 1],
  [203, 188, 153, 97, 32, 1],
  [877, 825, 706, 515, 275, 64, 1],
  [4140, 3937, 3479, 2744, 1785, 793, 128, 1],
  [21147, 20270, 18313, 15177, 11002, 6347, 2315, 256, 1],
  [115975, 111835, 102678, 88033, 68303, 45368, 23073, 6817, 512, 1],
  [678570, 657423, 610989, 536882, 436297, 316305, 191866, 85475, 20195, 1024, 1],
...
For example, if n=4, m=3, then T(4,3) = 8, because out of the A000110(4) = 15 set partitions of {1,2,3,4}, those that have 2 or more blocks contained in {1,2,3} are
  {12,3,4},
  {13,2,4},
  {14,2,3},
  {23,1,4},
  {24,1,3},
  {34,1,2},
  {1,2,3,4},
  while
  {1234},
  {123,4},
  {124,3}
  {134,2}
  {234,1},
  {12,34}
  {13. 24}.
  {14, 23}
  do not.
		

References

  • D. E. Knuth, The Art of Computer Programming, Volume 4B, exercise 7.2.2.1--185, answer on page 468.

Crossrefs

See A113547 and A362925 for other versions of this triangle.
Row sums give A005493.

Programs

  • Maple
    with(combinat);
    T:=proc(n,m) local k;
    add(stirling2(n-m,k)*(k+1)^m, k=0..n-m);
    end;
  • Mathematica
    A362924[n_,m_]:=Sum[StirlingS2[n-m,k](k+1)^m,{k,0,n-m}];
    Table[A362924[n,m],{n,15},{m,n}] (* Paolo Xausa, Dec 02 2023 *)

Formula

T(n, 1) = Bell number (all set partitions) A000110(n);
T(n, n) = 1 when m=n (the only possibility is a single block);
T(n, n-1) = 2^{n-1} when m=n-1 (a single block or two blocks);
T(n, 2) = A078468(2).
In general, T(n, m) = Sum_{k=0..n-m} Stirling_2(n-m,k)*(k+1)^m.

A367820 Number of partitions of [2n] that have at most one block contained in [n].

Original entry on oeis.org

1, 2, 13, 153, 2744, 68303, 2224417, 90995838, 4538437039, 269755223485, 18766884323562, 1506040068195721, 137740473851280141, 14212098473767962472, 1640078704487165930485, 210103319793655159244093, 29684467774817808296383256, 4598958815992575305097910699
Offset: 0

Views

Author

Alois P. Heinz, Dec 01 2023

Keywords

Examples

			a(2) = 13: 1234, 123|4, 124|3, 12|34, 12|3|4, 134|2, 13|24, 13|2|4, 14|23, 1|234, 1|23|4, 14|2|3, 1|24|3.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; expand(`if`(n=0, 1,
          x*add(b(n-j)*binomial(n-1, j-1), j=1..n)))
        end:
    a:= n-> add(coeff(b(n), x, j)*(j+1)^n, j=0..n):
    seq(a(n), n=0..21);
  • Mathematica
    A367820[n_]:=Sum[StirlingS2[n,j](j+1)^n,{j,0,n}];
    Array[A367820,25,0] (* Paolo Xausa, Dec 04 2023 *)

Formula

a(n) = A113547(2n+1,n+1) = A362925(2n,n).
a(n) = Sum_{j=0..n} (j+1)^n * Stirling2(n,j).
a(n) mod 2 = A011655(n+2).
Showing 1-6 of 6 results.