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-3 of 3 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

A262280 Number of ways to select a nonempty subset s from an n-set and then partition s into blocks of equal size.

Original entry on oeis.org

0, 1, 4, 11, 29, 72, 190, 527, 1552, 5031, 18087, 66904, 266381, 1164516, 5215644, 23868103, 117740143, 609872350, 3268548406, 18110463455, 102867877414, 620476915965, 4005216028161, 25747549921338, 166978155172420, 1168774024335203, 8556355097320141
Offset: 0

Views

Author

Alois P. Heinz, Sep 17 2015

Keywords

Examples

			a(3) = 11: 1, 2, 3, 12, 1|2, 13, 1|3, 23, 2|3, 123, 1|2|3.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember;
          add(1/(d!*(n/d)!^d), d=numtheory[divisors](n))
        end:
    a:= n-> n! * add(b(k)/(n-k)!, k=1..n):
    seq(a(n), n=0..30);
  • Mathematica
    b[n_] := b[n] = DivisorSum[n, 1/(#!*(n/#)!^#)&]; a[n_] := n!*Sum[b[k]/(n-k)!, {k, 1, n}]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Feb 15 2017, translated from Maple *)

Formula

E.g.f.: exp(x) * Sum_{k>=1} (exp(x^k/k!)-1).
a(n) = Sum_{k=1..n} C(n,k) * A038041(k).
a(n) = A262320(n) - 1.

A262321 Number of ways to select a subset s containing n from {1,...,n} and then partition s into blocks of equal size.

Original entry on oeis.org

1, 1, 3, 7, 18, 43, 118, 337, 1025, 3479, 13056, 48817, 199477, 898135, 4051128, 18652459, 93872040, 492132207, 2658676056, 14841915049, 84757413959, 517609038551, 3384739112196, 21742333893177, 141230605251082, 1001795869162783, 7387581072984938
Offset: 0

Views

Author

Alois P. Heinz, Sep 18 2015

Keywords

Comments

a(0) = 1 by convention.

Examples

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

Crossrefs

First differences of A262320.

Programs

  • Maple
    b:= proc(n) option remember; n!*`if`(n=0, 1,
           add(1/(d!*(n/d)!^d), d=numtheory[divisors](n)))
        end:
    a:= n-> add(b(k)*binomial(n-1, k-1), k=0..n):
    seq(a(n), n=0..30);
  • Mathematica
    b[n_] := b[n] = n!*If[n == 0, 1, DivisorSum[n, 1/(#!*(n/#)!^#)&]];
    a[n_] :=  Sum[b[k]*Binomial[n-1, k-1], {k, 0, n}];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 28 2017, translated from Maple *)

Formula

E.g.f.: A(x) - Integral_{x} A(x) dx, with A(x) = e.g.f. of A262320.
Showing 1-3 of 3 results.