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.

A038041 Number of ways to partition an n-set into subsets of equal size.

Original entry on oeis.org

1, 2, 2, 5, 2, 27, 2, 142, 282, 1073, 2, 32034, 2, 136853, 1527528, 4661087, 2, 227932993, 2, 3689854456, 36278688162, 13749663293, 2, 14084955889019, 5194672859378, 7905858780927, 2977584150505252, 13422745388226152, 2, 1349877580746537123, 2
Offset: 1

Views

Author

Keywords

Comments

a(n) = 2 iff n is prime with a(p) = card{ 1|2|3|...|p-1|p, 123...p } = 2. - Bernard Schott, May 16 2019

Examples

			a(4) = card{ 1|2|3|4, 12|34, 14|23, 13|24, 1234 } = 5.
From _Gus Wiseman_, Jul 12 2019: (Start)
The a(6) = 27 set partitions:
  {{1}{2}{3}{4}{5}{6}}  {{12}{34}{56}}  {{123}{456}}  {{123456}}
                        {{12}{35}{46}}  {{124}{356}}
                        {{12}{36}{45}}  {{125}{346}}
                        {{13}{24}{56}}  {{126}{345}}
                        {{13}{25}{46}}  {{134}{256}}
                        {{13}{26}{45}}  {{135}{246}}
                        {{14}{23}{56}}  {{136}{245}}
                        {{14}{25}{36}}  {{145}{236}}
                        {{14}{26}{35}}  {{146}{235}}
                        {{15}{23}{46}}  {{156}{234}}
                        {{15}{24}{36}}
                        {{15}{26}{34}}
                        {{16}{23}{45}}
                        {{16}{24}{35}}
                        {{16}{25}{34}}
(End)
		

Crossrefs

Cf. A061095 (same but with labeled boxes), A005225, A236696, A055225, A262280, A262320.
Column k=1 of A208437.
Row sums of A200472 and A200473.
Cf. A000110, A007837 (different lengths), A035470 (equal sums), A275780, A317583, A320324, A322794, A326512 (equal averages), A326513.

Programs

  • Maple
    A038041 := proc(n) local d;
    add(n!/(d!*(n/d)!^d), d = numtheory[divisors](n)) end:
    seq(A038041(n),n = 1..29); # Peter Luschny, Apr 16 2011
  • Mathematica
    a[n_] := Block[{d = Divisors@ n}, Plus @@ (n!/(#! (n/#)!^#) & /@ d)]; Array[a, 29] (* Robert G. Wilson v, Apr 16 2011 *)
    Table[Sum[n!/((n/d)!*(d!)^(n/d)), {d, Divisors[n]}], {n, 1, 31}] (* Emanuele Munarini, Jan 30 2014 *)
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[Range[n]],SameQ@@Length/@#&]],{n,0,8}] (* Gus Wiseman, Jul 12 2019 *)
  • Maxima
    a(n):= lsum(n!/((n/d)!*(d!)^(n/d)),d,listify(divisors(n)));
    makelist(a(n),n,1,40); /* Emanuele Munarini, Feb 03 2014 */
    
  • PARI
    /* compare to A061095 */
    mnom(v)=
    /* Multinomial coefficient s! / prod(j=1, n, v[j]!) where
      s= sum(j=1, n, v[j]) and n is the number of elements in v[]. */
    sum(j=1, #v, v[j])! / prod(j=1, #v, v[j]!)
    A038041(n)={local(r=0);fordiv(n,d,r+=mnom(vector(d,j,n/d))/d!);return(r);}
    vector(33,n,A038041(n)) /* Joerg Arndt, Apr 16 2011 */
    
  • Python
    import math
    def a(n):
        count = 0
        for k in range(1, n + 1):
            if n % k == 0:
                count += math.factorial(n) // (math.factorial(k) ** (n // k) * math.factorial(n // k))
        return count # Paul Muljadi, Sep 25 2024

Formula

a(n) = Sum_{d divides n} (n!/(d!*((n/d)!)^d)).
E.g.f.: Sum_{k >= 1} (exp(x^k/k!)-1).

Extensions

More terms from Erich Friedman

A022915 Multinomial coefficients (0, 1, ..., n)! = C(n+1,2)!/(0!*1!*2!*...*n!).

Original entry on oeis.org

1, 1, 3, 60, 12600, 37837800, 2053230379200, 2431106898187968000, 73566121315513295589120000, 65191584694745586153436251091200000, 1906765806522767212441719098019963758016000000, 2048024348726152339387799085049745725891853852479488000000
Offset: 0

Views

Author

Keywords

Comments

Number of ways to put numbers 1, 2, ..., n*(n+1)/2 in a triangular array of n rows in such a way that each row is increasing. Also number of ways to choose groups of 1, 2, 3, ..., n-1 and n objects out of n*(n+1)/2 objects. - Floor van Lamoen, Jul 16 2001
a(n) is the number of ways to linearly order the multiset {1,2,2,3,3,3,...n,n,...n}. - Geoffrey Critzer, Mar 08 2009
Also the number of distinct adjacency matrices in the n-triangular honeycomb rook graph. - Eric W. Weisstein, Jul 14 2017

Examples

			From _Gus Wiseman_, Aug 12 2020: (Start)
The a(3) = 60 permutations of the prime indices of A006939(3) = 360:
  (111223)  (121123)  (131122)  (212113)  (231211)
  (111232)  (121132)  (131212)  (212131)  (232111)
  (111322)  (121213)  (131221)  (212311)  (311122)
  (112123)  (121231)  (132112)  (213112)  (311212)
  (112132)  (121312)  (132121)  (213121)  (311221)
  (112213)  (121321)  (132211)  (213211)  (312112)
  (112231)  (122113)  (211123)  (221113)  (312121)
  (112312)  (122131)  (211132)  (221131)  (312211)
  (112321)  (122311)  (211213)  (221311)  (321112)
  (113122)  (123112)  (211231)  (223111)  (321121)
  (113212)  (123121)  (211312)  (231112)  (321211)
  (113221)  (123211)  (211321)  (231121)  (322111)
(End)
		

Crossrefs

A190945 counts the case of anti-run permutations.
A317829 counts partitions of this multiset.
A325617 is the version for factorials instead of superprimorials.
A006939 lists superprimorials or Chernoff numbers.
A008480 counts permutations of prime indices.
A181818 gives products of superprimorials, with complement A336426.

Programs

  • Maple
    with(combinat):
    a:= n-> multinomial(binomial(n+1, 2), $0..n):
    seq(a(n), n=0..12);  # Alois P. Heinz, May 18 2013
  • Mathematica
    Table[Apply[Multinomial ,Range[n]], {n, 0, 20}]  (* Geoffrey Critzer, Dec 09 2012 *)
    Table[Multinomial @@ Range[n], {n, 0, 20}] (* Eric W. Weisstein, Jul 14 2017 *)
    Table[Binomial[n + 1, 2]!/BarnesG[n + 2], {n, 0, 20}] (* Eric W. Weisstein, Jul 14 2017 *)
    Table[Length[Permutations[Join@@Table[i,{i,n},{i}]]],{n,0,4}] (* Gus Wiseman, Aug 12 2020 *)
  • PARI
    a(n) = binomial(n+1,2)!/prod(k=1, n, k^(n+1-k)); \\ Michel Marcus, May 02 2019

Formula

a(n) = (n*(n+1)/2)!/(0!*1!*2!*...*n!).
a(n) = a(n-1) * A014068(n). - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 08 2001.
a(n) = A052295(n)/A000178(n). - Lekraj Beedassy, Feb 19 2004
a(n) = A208437(n*(n+1)/2,n). - Alois P. Heinz, Apr 08 2016
a(n) ~ A * exp(n^2/4 + n + 1/6) * n^(n^2/2 + 7/12) / (2^((n+1)^2/2) * Pi^(n/2)), where A is the Glaisher-Kinkelin constant A074962. - Vaclav Kotesovec, May 02 2019
a(n) = A327803(n*(n+1)/2,n). - Alois P. Heinz, Sep 25 2019
a(n) = A008480(A006939(n)). - Gus Wiseman, Aug 12 2020

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 11 2001
More terms from Michel ten Voorde, Apr 12 2001
Better definition from L. Edson Jeffery, May 18 2013

A218868 Triangular array read by rows: T(n,k) is the number of n-permutations that have exactly k distinct cycle lengths.

Original entry on oeis.org

1, 2, 3, 3, 10, 14, 25, 95, 176, 424, 120, 721, 3269, 1050, 6406, 21202, 12712, 42561, 178443, 141876, 436402, 1622798, 1418400, 151200, 3628801, 17064179, 17061660, 2162160, 48073796, 177093256, 212254548, 41580000, 479001601, 2293658861, 2735287698, 719072640
Offset: 1

Views

Author

Geoffrey Critzer, Nov 07 2012

Keywords

Comments

T(A000217(n),n) gives A246292. - Alois P. Heinz, Aug 21 2014

Examples

			:      1;
:      2;
:      3,       3;
:     10,      14;
:     25,      95;
:    176,     424,     120;
:    721,    3269,    1050;
:   6406,   21202,   12712;
:  42561,  178443,  141876;
: 436402, 1622798, 1418400, 151200;
		

Crossrefs

Columns k=1-3 give: A005225, A005772, A133119.
Row sums are: A000142.
Row lengths are: A003056.
Cf. A208437, A242027 (the same for endofunctions), A246292, A317327.

Programs

  • Maple
    with(combinat):
    b:= proc(n, i) option remember; expand(`if`(n=0, 1,
          `if`(i<1, 0, add((i-1)!^j*multinomial(n, n-i*j, i$j)/j!*
          b(n-i*j, i-1)*`if`(j=0, 1, x), j=0..n/i))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n$2)):
    seq(T(n), n=1..16);  # Alois P. Heinz, Aug 21 2014
  • Mathematica
    nn=10;a=Product[1-y+y Exp[x^i/i],{i,1,nn}];f[list_]:=Select[list,#>0&];Map[f,Drop[Range[0,nn]!CoefficientList[Series[a ,{x,0,nn}],{x,y}],1]]//Grid

Formula

E.g.f.: Product_{i>=1} (1 + y*exp(x^i/i) - y).

A088142 Number of partitions of n-set with 2 block sizes.

Original entry on oeis.org

3, 10, 50, 116, 560, 1730, 6123, 30122, 116908, 507277, 2492737, 15328119, 56182092, 441156796, 2093130576, 15965840718, 77353276330, 693400983344, 3517825829117, 35126205660152, 187347585491624, 1952969742765476
Offset: 3

Views

Author

Vladeta Jovovic, Nov 02 2003

Keywords

Crossrefs

Column k=2 of A208437.

Programs

  • Maple
    with(numtheory): with(combinat):
    a:= n-> add(add(add(multinomial(n, i$j, d$((n-i*j)/d))/j!/((n-i*j)/d)!,
            d=select(x->xAlois P. Heinz, Feb 01 2014
  • Mathematica
    max = 25; G[x_] = Sum[Exp[x^k/k!]-1, {k, 1, max}]; H[x_] = Sum[(Exp[x^k/k!]-1)^2, {k, 1, max}]; Drop[CoefficientList[(G[x]^2-H[x])/2 + O[x]^max, x]*Range[0, max-1]!, 3] (* Jean-François Alcover, Jul 01 2015 *)

Formula

E.g.f.: (G(x)^2-H(x))/2 where G(x) = Sum {k>=1} (exp(x^k/k!)-1) and H(x) = Sum {k>=1} (exp(x^k/k!)-1)^2. - Vladeta Jovovic, Sep 18 2007

A371788 Triangle read by rows where T(n,k) is the number of set partitions of {1..n} with exactly k distinct block-sums.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 2, 1, 0, 2, 8, 4, 1, 0, 2, 19, 24, 6, 1, 0, 2, 47, 95, 49, 9, 1, 0, 6, 105, 363, 297, 93, 12, 1, 0, 12, 248, 1292, 1660, 753, 158, 16, 1, 0, 11, 563, 4649, 8409, 5591, 1653, 250, 20, 1, 0, 2, 1414, 15976, 41264, 38074, 15590, 3249, 380, 25, 1
Offset: 0

Views

Author

Gus Wiseman, Apr 16 2024

Keywords

Examples

			The set partition {{1,3},{2},{4}} has two distinct block-sums {2,4} so is counted under T(4,2).
Triangle begins:
     1
     0     1
     0     1     1
     0     2     2     1
     0     2     8     4     1
     0     2    19    24     6     1
     0     2    47    95    49     9     1
     0     6   105   363   297    93    12     1
     0    12   248  1292  1660   753   158    16     1
     0    11   563  4649  8409  5591  1653   250    20     1
     0     2  1414 15976 41264 38074 15590  3249   380    25     1
Row n = 4 counts the following set partitions:
  .  {{1,4},{2,3}}  {{1},{2,3,4}}    {{1},{2},{3,4}}  {{1},{2},{3},{4}}
     {{1,2,3,4}}    {{1,2},{3},{4}}  {{1},{2,3},{4}}
                    {{1,2},{3,4}}    {{1},{2,4},{3}}
                    {{1,3},{2},{4}}  {{1,4},{2},{3}}
                    {{1,3},{2,4}}
                    {{1,2,3},{4}}
                    {{1,2,4},{3}}
                    {{1,3,4},{2}}
		

Crossrefs

Row sums are A000110.
Column k = 1 is A035470.
A version for integer partitions is A116608.
For block lengths instead of sums we have A208437.
A008277 counts set partitions by length.
A275780 counts set partitions with distinct block-sums.
A371737 counts quanimous strict partitions, non-strict A321452.
A371789 counts non-quanimous sets, differences A371790.

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[Union[Total/@#]]==k&]],{n,0,5},{k,0,n}]

A133118 Number of partitions of n-set with 3 block sizes.

Original entry on oeis.org

60, 315, 2268, 14742, 72180, 464640, 2676366, 16400098, 94209206, 673282610, 4095231104, 29371828846, 197547348216, 1513916607683, 10904464442572, 87070803499372, 673555061736062, 5718121102062336, 47028289679340734, 418812093667530755, 3680961843042545490, 34161428275433710485
Offset: 6

Views

Author

Vladeta Jovovic, Sep 18 2007

Keywords

Crossrefs

Column k=3 of A208437.

Programs

  • Mathematica
    multinomial[n_, k_List] := n!/Times @@ (k!);
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, Sum[multinomial[n, Prepend[Table[i, {j}], n - i*j]]/j!*b[n - i*j, i - 1]*If[j == 0, 1, x], {j, 0, n/i}]]];
    a[n_] := Coefficient[b[n, n], x, 3];
    Array[a, 22, 6] (* Jean-François Alcover, May 24 2019, after Alois P. Heinz in A208437 *)

Formula

We obtain e.g.f. for number of partitions of n-set with m block sizes if we substitute x(i) with -Sum_{k>0} (1-exp(x^k/k!))^i in cycle index Z(S(m); x(1),x(2),...,x(n)) of symmetric group S(m) of degree m.

Extensions

More terms from Max Alekseyev, Jun 17 2011
Showing 1-6 of 6 results.