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

A270236 Triangle T(n,p) read by rows: the number of occurrences of p in the restricted growth functions of length n.

Original entry on oeis.org

1, 3, 1, 9, 5, 1, 30, 21, 8, 1, 112, 88, 47, 12, 1, 463, 387, 253, 97, 17, 1, 2095, 1816, 1345, 675, 184, 23, 1, 10279, 9123, 7304, 4418, 1641, 324, 30, 1, 54267, 48971, 41193, 28396, 13276, 3645, 536, 38, 1, 306298, 279855, 243152, 183615, 102244, 36223, 7473, 842, 47, 1
Offset: 1

Views

Author

R. J. Mathar, Mar 13 2016

Keywords

Comments

The RG functions used here are defined by f(1)=1, f(j) <= 1+max_{i
T(n,p) is the number of elements in the p-th subset in all set partitions of [n]. - Joerg Arndt, Mar 14 2016

Examples

			The two restricted growth functions of length 2 are (1,1) and (1,2). The 1 appears 3 times and the 2 once, so T(2,1)=3 and T(2,2)=1.
1;
3,1;
9,5,1;
30,21,8,1;
112,88,47,12,1;
463,387,253,97,17,1;
2095,1816,1345,675,184,23,1;
10279,9123,7304,4418,1641,324,30,1;
54267,48971,41193,28396,13276,3645,536,38,1;
306298,279855,243152,183615,102244,36223,7473,842,47,1;
1838320,1695902,1506521,1211936,770989,334751,90223,14303,1267,57,1;
11677867,10856879,9799547,8237223,5795889,2965654,995191,207186,25820, 1839,68,1;
		

Crossrefs

Cf. A070071 (row sums).
T(2n+1,n+1) gives A270529.

Programs

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

Formula

T(n,n) = 1.
Conjecture: T(n,n-1) = 2+n*(n-1)/2 for n>1.
Conjecture: T(n+1,n-1) = 2+n*(n+1)*(3*n^2-5*n+26)/24 for n>1.
Sum_{k=1..n} k * T(n,k) = A346772(n). - Alois P. Heinz, Aug 03 2021

A105488 Number of partitions of {1...n} containing 2 detached pairs of consecutive integers, i.e., partitions in which only 1- or 2-strings of consecutive integers can appear in a block and there are exactly two 2-strings.

Original entry on oeis.org

1, 6, 30, 150, 780, 4263, 24556, 149040, 951615, 6378625, 44785620, 328660566, 2515643767, 20044428810, 165955025400, 1425299331992, 12678325080012, 116635133853189, 1108221018960830, 10862073229428120, 109694927532209481, 1140199081827172719
Offset: 4

Author

Augustine O. Munagi, Apr 10 2005

Keywords

Comments

Number of partitions enumerated by A105479 in which the maximal length of consecutive integers in a block is 2.
With offset 2t, number of partitions of {1...N} containing 2 detached strings of t consecutive integers, where N=n+2j, t=2+j, j = 0,1,2,..., i.e., partitions of [n] in which only v-strings of consecutive integers can appear in a block, where v=1 or v=t and there are exactly two t-strings.
Equals the minimum of the sum of the Rand distances over all A000110(n) set partitions of n elements. E.g. a(3) = 6 because over the 5 set partitions of {1, 2, 3} the sum of Rand distances from {{1}, {2}, {3}} to the rest is 6. - Andrey Goder (andy.goder(AT)gmail.com), Dec 08 2006
a(n+3) = A000110(n) * A000217(n) = Sum_{k=1..n} A285362(n,k) is the sum of the entries in all set partitions of [n]. - Alois P. Heinz, Apr 16 2017

Examples

			a(5)=6 because the partitions of {1,2,3,4,5} with 2 detached pairs of consecutive integers are 145/23,125/34,1245/3,12/34/5,12/3/45,1/23/45.
		

Programs

  • Maple
    seq(binomial(n-2,2)*combinat[bell](n-3),n=4..28);
  • Mathematica
    a[n_] := Binomial[n-2, 2]*BellB[n-3];
    Table[a[n], {n, 4, 25}] (* Jean-François Alcover, May 11 2019 *)

Formula

a(n) = binomial(n-2, 2)*Bell(n-3), which is the case r = 2 in the general case of r pairs, d(n, r)=binomial(n-r, r)*Bell(n-r-1), which is the case t=2 of the general formula d(n, r, t)=binomial(n-r*(t-1), r)*B(n-r*(t-1)-1).

A285439 Sum T(n,k) of the entries in the k-th cycles of all permutations of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 21, 12, 3, 132, 76, 28, 4, 960, 545, 235, 55, 5, 7920, 4422, 2064, 612, 96, 6, 73080, 40194, 19607, 6692, 1386, 154, 7, 745920, 405072, 202792, 75944, 18736, 2816, 232, 8, 8346240, 4484808, 2280834, 911637, 254061, 46422, 5256, 333, 9
Offset: 1

Author

Alois P. Heinz, Apr 19 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Examples

			T(3,1) = 21 because the sum of the entries in the first cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 6+6+3+4+1+1 = 21.
Triangle T(n,k) begins:
       1;
       4,      2;
      21,     12,      3;
     132,     76,     28,     4;
     960,    545,    235,    55,     5;
    7920,   4422,   2064,   612,    96,    6;
   73080,  40194,  19607,  6692,  1386,  154,   7;
  745920, 405072, 202792, 75944, 18736, 2816, 232, 8;
  ...
		

Crossrefs

Columns k=1-2 give: A284816, A285489.
Row sums give A000142 * A000217 = A180119.
Main diagonal and first lower diagonal give: A000027, A006000 (for n>0).

Programs

  • Maple
    T:= proc(h) option remember; local b; b:=
          proc(n, l) option remember; `if`(n=0, [mul((i-1)!, i=l), 0],
            (p-> p+[0, (h-n+1)*p[1]*x^(nops(l)+1)])(b(n-1, [l[], 1]))+
             add((p-> p+[0, (h-n+1)*p[1]*x^j])(
             b(n-1, subsop(j=l[j]+1, l))), j=1..nops(l)))
          end: (p-> seq(coeff(p, x, i), i=1..n))(b(h, [])[2])
        end:
    seq(T(n), n=1..10);
  • Mathematica
    T[h_] := T[h] = Module[{b}, b[n_, l_] := b[n, l] = If[n == 0, {Product[(i - 1)!, {i, l}], 0}, # + {0, (h - n + 1)*#[[1]]*x^(Length[l] + 1)}&[b[n - 1, Append[l, 1]]] + Sum[# + {0, (h-n+1)*#[[1]]*x^j}&[b[n - 1, ReplacePart[ l, j -> l[[j]] + 1]]], {j, 1, Length[l]}]]; Table[Coefficient[#, x, i], {i, 1, n}]&[b[h, {}][[2]]]];
    Table[T[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, May 25 2018, translated from Maple *)

Formula

Sum_{k=1..n} k * T(n,k) = n^2 * n! = A002775(n).

A285595 Sum T(n,k) of the k-th entries in all blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 17, 10, 3, 76, 52, 18, 4, 362, 274, 111, 28, 5, 1842, 1500, 675, 200, 40, 6, 9991, 8614, 4185, 1380, 325, 54, 7, 57568, 51992, 26832, 9568, 2510, 492, 70, 8, 351125, 329650, 178755, 67820, 19255, 4206, 707, 88, 9, 2259302, 2192434, 1239351, 494828, 149605, 35382, 6629, 976, 108, 10
Offset: 1

Author

Alois P. Heinz, Apr 22 2017

Keywords

Comments

T(n,k) is also k times the number of blocks of size >k in all set partitions of [n+1]. T(3,2) = 10 = 2 * 5 because there are 5 blocks of size >2 in all set partitions of [4], namely in 1234, 123|4, 124|3, 134|2, 1|234.

Examples

			T(3,2) = 10 because the sum of the second entries in all blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 2+2+3+3+0  = 10.
Triangle T(n,k) begins:
      1;
      4,     2;
     17,    10,     3;
     76,    52,    18,    4;
    362,   274,   111,   28,    5;
   1842,  1500,   675,  200,   40,   6;
   9991,  8614,  4185, 1380,  325,  54,  7;
  57568, 51992, 26832, 9568, 2510, 492, 70, 8;
  ...
		

Crossrefs

Column k=1 gives A124325(n+1).
Row sums give A000110(n) * A000217(n) = A105488(n+3).
Main diagonal and first lower diagonal give: A000027, A028552.

Programs

  • Maple
    T:= proc(h) option remember; local b; b:=
          proc(n, l) option remember; `if`(n=0, [1, 0],
            (p-> p+[0, (h-n+1)*p[1]*x^1])(b(n-1, [l[], 1]))+
             add((p-> p+[0, (h-n+1)*p[1]*x^(l[j]+1)])(b(n-1,
             sort(subsop(j=l[j]+1, l), `>`))), j=1..nops(l)))
          end: (p-> seq(coeff(p, x, i), i=1..n))(b(h, [])[2])
        end:
    seq(T(n), n=1..12);
    # second Maple program:
    b:= proc(n) option remember; `if`(n=0, [1, 0],
          add((p-> p+[0, p[1]*add(x^k, k=1..j-1)])(
             b(n-j)*binomial(n-1, j-1)), j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i)*i, i=1..n))(b(n+1)[2]):
    seq(T(n), n=1..12);
  • Mathematica
    b[n_] := b[n] = If[n == 0, {1, 0}, Sum[# + {0, #[[1]]*Sum[x^k, {k, 1, j-1} ]}&[b[n - j]*Binomial[n - 1, j - 1]], {j, 1, n}]];
    T[n_] := Table[Coefficient[#, x, i]*i, {i, 1, n}] &[b[n + 1][[2]]];
    Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, May 23 2018, translated from 2nd Maple program *)

Formula

T(n,k) = k * Sum_{j=k+1..n+1} binomial(n+1,j)*A000110(n+1-j).
T(n,k) = k * Sum_{j=k+1..n+1} A175757(n+1,j).
Sum_{k=1..n} T(n,k)/k = A278677(n-1).

A285363 Sum of the entries in the first blocks of all set partitions of [n].

Original entry on oeis.org

1, 4, 15, 60, 262, 1243, 6358, 34835, 203307, 1257913, 8216945, 56463487, 406868167, 3065920770, 24099977863, 197179545722, 1675846476148, 14769104672839, 134745258569108, 1270767279092285, 12371426210292311, 124173909409948575, 1283498833928098171
Offset: 1

Author

Alois P. Heinz, Apr 17 2017

Keywords

Examples

			a(3) = 15 because the sum of the entries in the first blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 6+3+4+1+1 = 15.
		

Crossrefs

Column k=1 of A285362.

Programs

  • Maple
    a:= proc(h) option remember; local b; b:=
          proc(n, m) option remember;
            `if`(n=0, [1, 0], add((p-> `if`(j=1, p+ [0,
            (h-n+1)*p[1]], p))(b(n-1, max(m, j))), j=1..m+1))
          end: b(h, 0)[2]
        end:
    seq(a(n), n=1..30);
  • Mathematica
    a[h_] := a[h] = Module[{b}, b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[If[j == 1, # + {0, (h - n + 1)*#[[1]]}, #]&[b[n - 1, Max[m, j]]], {j, 1, m + 1}]]; b[h, 0][[2]]];
    Table[a[n], {n, 1, 30}] (* Jean-François Alcover, May 20 2018, translated from Maple *)

Formula

a(n) = A285362(n,1).

A285424 Sum of the entries in the last blocks of all set partitions of [n].

Original entry on oeis.org

1, 5, 19, 75, 323, 1512, 7630, 41245, 237573, 1451359, 9365361, 63604596, 453206838, 3378581609, 26285755211, 212953670251, 1792896572319, 15658150745252, 141619251656826, 1324477898999161, 12791059496663293, 127395689514237279, 1307010496324272157
Offset: 1

Author

Alois P. Heinz, Apr 18 2017

Keywords

Examples

			a(3) = 19 because the sum of the entries in the last blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 6+3+2+5+3 = 19.
		

Crossrefs

Column k=1 of A286232.

Programs

  • Maple
    a:= proc(h) option remember; local b; b:=
          proc(n, m, s) option remember; `if`(n=0, s,
            add(b(n-1, max(m, j), `if`(j
    				
  • Mathematica
    a[h_] := a[h] = Module[{b}, b[n_, m_, s_] := b[n, m, s] = If[n == 0, s,   Sum[b[n-1, Max[m, j], If[j < m, s, h - n + 1 + If[j == m, s, 0]]], {j, 1, m + 1}]]; b[h, 0, 0]];
    Array[a, 25] (* Jean-François Alcover, May 22 2018, translated from Maple *)

A286232 Sum T(n,k) of the entries in the k-th last blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 5, 1, 19, 10, 1, 75, 57, 17, 1, 323, 285, 145, 26, 1, 1512, 1421, 975, 317, 37, 1, 7630, 7395, 5999, 2865, 616, 50, 1, 41245, 40726, 36183, 22411, 7315, 1094, 65, 1, 237573, 237759, 221689, 163488, 72581, 16630, 1812, 82, 1, 1451359, 1468162, 1405001, 1160764, 649723, 206249, 34425, 2840, 101, 1
Offset: 1

Author

Alois P. Heinz, May 04 2017

Keywords

Examples

			T(3,2) = 10 because the sum of the entries in the second last blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 0+3+4+1+2 = 10.
Triangle T(n,k) begins:
      1;
      5,     1;
     19,    10,     1;
     75,    57,    17,     1;
    323,   285,   145,    26,    1;
   1512,  1421,   975,   317,   37,    1;
   7630,  7395,  5999,  2865,  616,   50,  1;
  41245, 40726, 36183, 22411, 7315, 1094, 65, 1;
  ...
		

Crossrefs

Column k=1 gives A285424.
Main diagonal and first lower diagonal give: A000012, A002522.
Row sums give A000110(n) * A000217(n) = A105488(n+3).

Programs

  • Mathematica
    app[P_, n_] := Module[{P0}, Table[P0 = Append[P, {}]; AppendTo[P0[[i]], n]; If[Last[P0] == {}, Most[P0], P0], {i, 1, Length[P]+1}]];
    setPartitions[n_] := setPartitions[n] = If[n == 1, {{{1}}}, Flatten[app[#, n]& /@ setPartitions[n-1], 1]];
    T[n_, k_] := Select[setPartitions[n], Length[#] >= k&][[All, -k]] // Flatten // Total;
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Aug 21 2021 *)

A285410 Sum of the entries in the (n+1)-th blocks of all set partitions of [2n+1].

Original entry on oeis.org

1, 12, 185, 3757, 96454, 3018824, 111964040, 4813480830, 235727269842, 12967143328027, 792113203502422, 53224214308284463, 3902445739220008603, 310108348556403600064, 26551900616231571763742, 2437107937223749442138164, 238735439946016510599661488
Offset: 0

Author

Alois P. Heinz, Apr 18 2017

Keywords

Examples

			a(1) = 12 because the sum of the entries in the second blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 0+3+2+5+2 = 12.
		

Crossrefs

Programs

  • Maple
    a:= proc(h) option remember; local b; b:=
          proc(n, m) option remember;
            `if`(n=0, [1, 0], add((p-> `if`(j=h+1, p+ [0,
            (2*h-n+2)*p[1]], p))(b(n-1, max(m, j))), j=1..m+1))
          end: b(2*h+1, 0)[2]
        end:
    seq(a(n), n=0..20);
  • Mathematica
    a[h_] := a[h] = Module[{b}, b[0, ] = {1, 0}; b[n, m_] := b[n, m] = Sum[ If[j == h + 1, # + {0, (2*h - n + 2)*#[[1]]}, #]&[b[n - 1, Max[m, j]]], {j, 1, m + 1}]; b[2*h + 1, 0][[2]]];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, May 23 2018, translated from Maple *)

Formula

a(n) = A285362(2n+1,n+1).

A285364 Sum of the entries in the second blocks of all set partitions of [n].

Original entry on oeis.org

2, 12, 58, 273, 1329, 6839, 37423, 217606, 1340597, 8719806, 59680387, 428481322, 3218109788, 25220647760, 205790862332, 1744755841379, 15342274425585, 139692065365753, 1314995731359189, 12780466391685166, 128081591768679823, 1322011886920066940
Offset: 2

Author

Alois P. Heinz, Apr 17 2017

Keywords

Examples

			a(3) = 12 because the sum of the entries in the second blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 0+3+2+5+2 = 12.
		

Crossrefs

Column k=2 of A285362.

Programs

  • Maple
    a:= proc(h) option remember; local b; b:=
          proc(n, m) option remember;
            `if`(n=0, [1, 0], add((p-> `if`(j=2, p+ [0,
            (h-n+1)*p[1]], p))(b(n-1, max(m, j))), j=1..m+1))
          end: b(h, 0)[2]
        end:
    seq(a(n), n=2..30);
  • Mathematica
    a[h_] := a[h] = Module[{b}, b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[Function[p, If[j == 2, p + {0, (h - n + 1)*p[[1]]}, p]][b[n - 1, Max[m, j]]], {j, 1, m + 1}]]; b[h, 0][[2]]];
    Table[a[n], {n, 2, 30}] (* Jean-François Alcover, May 27 2018, from Maple *)

Formula

a(n) = A285362(n,2).

A285365 Sum of the entries in the third blocks of all set partitions of [n].

Original entry on oeis.org

3, 28, 185, 1094, 6293, 36619, 219931, 1376929, 9023266, 61944014, 445076570, 3341575188, 26164558199, 213243368898, 1805626838935, 15856747810014, 144189514375955, 1355629263039685, 13159535002316403, 131729480987412527, 1358188539892586220
Offset: 3

Author

Alois P. Heinz, Apr 17 2017

Keywords

Examples

			a(3) = 3 because the sum of the entries in the third blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 0+0+0+0+3 = 3.
		

Crossrefs

Column k=3 of A285362.

Programs

  • Maple
    a:= proc(h) option remember; local b; b:=
          proc(n, m) option remember;
            `if`(n=0, [1, 0], add((p-> `if`(j=3, p+ [0,
            (h-n+1)*p[1]], p))(b(n-1, max(m, j))), j=1..m+1))
          end: b(h, 0)[2]
        end:
    seq(a(n), n=3..30);
  • Mathematica
    a[h_] := a[h] = Module[{b}, b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[Function[p, If[j == 3, p + {0, (h - n + 1)*p[[1]]}, p]][b[n - 1, Max[m, j]]], {j, 1, m + 1}]]; b[h, 0][[2]]];
    Table[a[n], {n, 3, 30}] (* Jean-François Alcover, May 27 2018, from Maple *)

Formula

a(n) = A285362(n,3).
Showing 1-10 of 17 results. Next