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

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

A057625 a(n) = n! * sum 1/k! where the sum is over all positive integers k that divide n.

Original entry on oeis.org

1, 3, 7, 37, 121, 1201, 5041, 62161, 423361, 5473441, 39916801, 818959681, 6227020801, 130784734081, 1536517382401, 32256486662401, 355687428096001, 10679532671808001, 121645100408832001, 3770998783116364801, 59616236292028416001, 1686001119824999577601
Offset: 1

Views

Author

Leroy Quet, Oct 09 2000

Keywords

Comments

Sets of lists of equal size, cf. A000262. - Vladeta Jovovic, Nov 02 2003
From Gus Wiseman, Jan 10 2019: (Start)
Number of matrices whose entries are 1,...,n, up to column permutations. For example, inequivalent representatives of the a(4) = 37 matrices are:
One 1 X 4 matrix:
[1234]
12 2 X 2 matrices:
[12] [12] [13] [13] [14] [14] [23] [23] [24] [24] [34] [34]
[34] [43] [24] [42] [23] [32] [14] [41] [13] [31] [12] [21]
and 24 4 X 1 matrices:
[1][1][1][1][1][1][2][2][2][2][2][2][3][3][3][3][3][3][4][4][4][4][4][4]
[2][2][3][3][4][4][1][1][3][3][4][4][1][1][2][2][4][4][1][1][2][2][3][3]
[3][4][2][4][2][3][3][4][1][4][1][3][2][4][1][4][1][2][2][3][1][3][1][2]
[4][3][4][2][3][2][4][3][4][1][3][1][4][2][4][1][2][1][3][2][3][1][2][1]
in total 1+12+24 = 37.
(End)

Examples

			a(4) = 4! (1 + 1/2! + 1/4!) = 24 (1 + 1/2 + 1/24) = 37.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := n! DivisorSum[n, 1/#! &]; Array[a, 22] (* Jean-François Alcover, Dec 23 2015 *)
  • PARI
    a(n)=n! * sumdiv(n, d, 1/d! );  /* Joerg Arndt, Oct 07 2012 */

Formula

E.g.f.: Sum_{n>0} (exp(x^n)-1). - Vladeta Jovovic, Dec 30 2001
E.g.f.: Sum_{k>0} x^k/k!/(1-x^k). - Vladeta Jovovic, Oct 14 2003
Equals the logarithmic derivative of A209903. - Paul D. Hanna, Jul 26 2012

A121860 a(n) = Sum_{d|n} n!/(d!*(n/d)!).

Original entry on oeis.org

1, 2, 2, 8, 2, 122, 2, 1682, 10082, 30242, 2, 7318082, 2, 17297282, 3632428802, 36843206402, 2, 2981705126402, 2, 1690185726028802, 3379030566912002, 28158588057602, 2, 76941821303636889602, 1077167364120207360002
Offset: 1

Views

Author

Vladeta Jovovic, Sep 09 2006

Keywords

Comments

a(n) = 2 iff n is prime.
a(468) has 1007 decimal digits. - Michael De Vlieger, Sep 12 2018
From Gus Wiseman, Jan 10 2019: (Start)
Number of matrices whose entries are 1,...,n, up to row and column permutations. For example, inequivalent representatives of the a(4) = 8 matrices are:
[1 2 3 4]
.
[1 2] [1 2] [1 3] [1 3] [1 4] [1 4]
[3 4] [4 3] [2 4] [4 2] [2 3] [3 2]
.
[1]
[2]
[3]
[4]
(End)
Conjecture: the sequence a(n) taken modulo a positive integer k >= 3 eventually becomes constant equal to 2. For example, the sequence taken modulo 11 is [1, 2, 2, 8, 2, 1, 2, 10, 6, 3, 2, 2, 2, 2, 2, 2, ...]. - Peter Bala, Aug 08 2025

Crossrefs

Programs

  • Maple
    with(numtheory): seq(n!*add(1/(d!*(n/d)!), d in divisors(n)), n = 1..25); # Peter Bala, Aug 04 2025
  • Mathematica
    f[n_] := Block[{d = Divisors@n}, Plus @@ (n!/(d! (n/d)!))]; Array[f, 25] (* Robert G. Wilson v, Sep 11 2006 *)
    Table[DivisorSum[n, n!/(#!*(n/#)!) &], {n, 25}] (* Michael De Vlieger, Sep 12 2018 *)
  • PARI
    a(n) = sumdiv(n, d, n!/(d!*(n/d)!)); \\ Michel Marcus, Sep 13 2018

Formula

E.g.f.: Sum_{k>0} (exp(x^k)-1)/k!.

Extensions

More terms from Robert G. Wilson v, Sep 11 2006

A087906 a(n) = Sum_{d|n} (n-1)!/(d-1)!.

Original entry on oeis.org

1, 2, 3, 13, 25, 301, 721, 10921, 60481, 740881, 3628801, 106777441, 479001601, 12462690241, 134399865601, 2833553923201, 20922789888001, 892191453753601, 6402373705728001, 268633265290790401, 3652732042831872001, 102181898422712908801, 1124000727777607680001
Offset: 1

Views

Author

Vladeta Jovovic, Oct 15 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Array[n \[Function] DivisorSum[n, (n - 1)!/(# - 1)! &], 25] (* J. Mulder (jasper.mulder(AT)planet.nl), Jan 25 2010 *)
  • PARI
    a(n)=sumdiv(n,d,(n-1)!/(d-1)!); \\ Joerg Arndt, May 21 2013

Formula

E.g.f.: Sum_{k>0} (exp(x^k)-1)/k = -Sum_{k>0} log(1-x^k)/k!.

Extensions

More terms from J. Mulder (jasper.mulder(AT)planet.nl), Jan 25 2010

A323295 Number of ways to fill a matrix with the first n positive integers.

Original entry on oeis.org

1, 1, 4, 12, 72, 240, 2880, 10080, 161280, 1088640, 14515200, 79833600, 2874009600, 12454041600, 348713164800, 5230697472000, 104613949440000, 711374856192000, 38414242234368000, 243290200817664000, 14597412049059840000, 204363768686837760000
Offset: 0

Views

Author

Gus Wiseman, Jan 12 2019

Keywords

Examples

			The a(4) = 72 matrices consist of:
  24 row/column permutations of [1 2 3 4]
+
  4 row/column permutations of [1 2]
                               [3 4]
+
  4 row/column permutations of [1 2]
                               [4 3]
+
  4 row/column permutations of [1 3]
                               [2 4]
+
  4 row/column permutations of [1 3]
                               [4 2]
+
  4 row/column permutations of [1 4]
                               [2 3]
+
  4 row/column permutations of [1 4]
                               [3 2]
+
  24 row/column permutations of [1]
                                [2]
                                [3]
                                [4]
		

Crossrefs

Programs

  • Mathematica
    Join[{1}, Table[DivisorSigma[0, n]*n!, {n, 30}]]
  • PARI
    a(n) = if (n==0, 1, numdiv(n)*n!); \\ Michel Marcus, Jan 15 2019

Formula

a(n) = A000005(n) * n! for n > 0, a(0) = 1.
E.g.f.: 1 + Sum_{k>=1} x^k/(1 - x^k). - Ilya Gutkovskiy, Sep 13 2019

A194560 G.f.: Sum_{n>=1} G_n(x)^n where G_n(x) = x + x*G_n(x)^n.

Original entry on oeis.org

1, 2, 2, 4, 2, 10, 2, 20, 14, 49, 2, 217, 2, 438, 310, 1580, 2, 6352, 2, 18062, 7824, 58799, 2, 258971, 2532, 742915, 246794, 2729095, 2, 11154954, 2, 35779660, 8414818, 129644809, 242354, 531132915, 2, 1767263211, 300830821, 6593815523, 2, 26289925026, 2, 91708135773
Offset: 1

Views

Author

Paul D. Hanna, Aug 28 2011

Keywords

Comments

Number of Dyck n-paths with all ascents of equal length. - David Scambler, Nov 17 2011
From Gus Wiseman, Feb 15 2019: (Start)
Also the number of uniform (all blocks have the same size) non-crossing set partitions of {1,...,n}. For example, the a(3) = 2 through a(6) = 10 uniform non-crossing set partitions are:
{{123}} {{1234}} {{12345}} {{123456}}
{{1}{2}{3}} {{12}{34}} {{1}{2}{3}{4}{5}} {{123}{456}}
{{14}{23}} {{126}{345}}
{{1}{2}{3}{4}} {{156}{234}}
{{12}{34}{56}}
{{12}{36}{45}}
{{14}{23}{56}}
{{16}{23}{45}}
{{16}{25}{34}}
{{1}{2}{3}{4}{5}{6}}
(End)

Examples

			G.f.: A(x) = x + 2*x^2 + 2*x^3 + 4*x^4 + 2*x^5 + 10*x^6 + 2*x^7 + ...
where
A(x) = G_1(x) + G_2(x)^2 + G_3(x)^3 + G_4(x)^4 + G_5(x)^5 + ...
and G_n(x) = x + x*G_n(x)^n is given by:
G_n(x) = Sum_{k>=0} C(n*k+1,k)/(n*k+1)*x^(n*k+1),
G_n(x)^n = Sum_{k>=1} C(n*k,k)/(n*k-k+1)*x^(n*k);
the first few expansions of G_n(x)^n begin:
G_1(x) = x + x^2 + x^3 + x^4 + x^5 + ...
G_2(x)^2 = x^2 + 2*x^4 + 5*x^6 + 14*x^8 + ... + A000108(n)*x^(2*n) + ...
G_3(x)^3 = x^3 + 3*x^6 + 12*x^9 + 55*x^12 + ... + A001764(n)*x^(3*n) + ...
G_4(x)^4 = x^4 + 4*x^8 + 22*x^12 + 140*x^16 + ... + A002293(n)*x^(4*n) + ...
G_5(x)^5 = x^5 + 5*x^10 + 35*x^15 + 285*x^20 + ... + A002294(n)*x^(5*n) + ...
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Binomial[n,d]/(n-d+1),{d,Divisors[n]}],{n,20}] (* Gus Wiseman, Feb 15 2019 *)
  • PARI
    {a(n)=if(n<1,0,sumdiv(n,d,binomial(n,d)/(n-d+1)))}
    
  • PARI
    {a(n)=polcoeff(sum(m=1,n,serreverse(x/(1+x^m+x*O(x^n)))^m),n)}

Formula

a(n) = Sum_{d|n} C(n,d)/(n-d+1).
G.f.: Sum_{n>=1} Series_Reversion( x/(1+x^n) )^n.

A320444 Number of uniform hypertrees spanning n vertices.

Original entry on oeis.org

1, 1, 1, 4, 17, 141, 1297, 17683, 262145, 4861405, 100112001, 2371816701, 61917364225, 1796326510993, 56693912375297, 1947734359001551, 72059082110369793, 2863257607266475419, 121439531096594251777, 5480987217944109919765, 262144000000000000000001
Offset: 0

Views

Author

Gus Wiseman, Jan 09 2019

Keywords

Comments

The density of a hypergraph is the sum of sizes of its edges minus the number of edges minus the number of vertices. A hypertree is a connected hypergraph of density -1. A hypergraph is uniform if its edges all have the same size. The span of a hypergraph is the union of its edges.

Examples

			Non-isomorphic representatives of the 5 unlabeled uniform hypertrees on 5 vertices and their multiplicities in the labeled case, which add up to a(5) = 141:
   5 X {{1,5},{2,5},{3,5},{4,5}}
  60 X {{1,4},{2,5},{3,5},{4,5}}
  60 X {{1,3},{2,4},{3,5},{4,5}}
  15 X {{1,2,5},{3,4,5}}
   1 X {{1,2,3,4,5}}
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local d; add((n-1)!/(d! * ((n-1)/d)!) * (n/d)^((n-1)/d - 1), d = numtheory:-divisors(n-1)); end proc:
    f(0):= 1: f(1):= 1:
    map(f, [$0..25]); # Robert Israel, Jan 10 2019
  • Mathematica
    Table[Sum[n!/(d!*(n/d)!)*((n+1)/d)^(n/d-1),{d,Divisors[n]}],{n,10}]
  • PARI
    a(n) = if (n<2, 1, n--; sumdiv(n, d, n!/(d! * (n/d)!) * ((n + 1)/d)^(n/d - 1))); \\ Michel Marcus, Jan 10 2019

Formula

a(n + 1) = Sum_{d|n} n!/(d! * (n/d)!) * ((n + 1)/d)^(n/d - 1).
a(p prime) = 1 + (p + 1)^(p - 1).

A327803 Sum T(n,k) of multinomials M(n; lambda), where lambda ranges over all partitions of n into parts that form a set of size k; triangle T(n,k), n>=0, 0<=k<=A003056(n), read by rows.

Original entry on oeis.org

1, 0, 1, 0, 3, 0, 7, 3, 0, 31, 16, 0, 121, 125, 0, 831, 711, 60, 0, 5041, 5915, 525, 0, 42911, 46264, 6328, 0, 364561, 438681, 67788, 0, 3742453, 4371085, 753420, 12600, 0, 39916801, 49321745, 8924685, 166320, 0, 486891175, 588219523, 113501784, 2966040
Offset: 0

Views

Author

Alois P. Heinz, Sep 25 2019

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  0,       1;
  0,       3;
  0,       7,       3;
  0,      31,      16;
  0,     121,     125;
  0,     831,     711,     60;
  0,    5041,    5915,    525;
  0,   42911,   46264,   6328;
  0,  364561,  438681,  67788;
  0, 3742453, 4371085, 753420, 12600;
  ...
		

Crossrefs

Columns k=0-2 give: A000007, A061095, A327826.
Row sums give A005651.
Cf. A000217, A003056, A022915, A131632 (when the parts are distinct), A226874.

Programs

  • Maple
    with(combinat):
    T:= (n, k)-> add(multinomial(add(i, i=l), l[], 0), l=
                 select(x-> nops({x[]})=k, partition(n))):
    seq(seq(T(n, k), k=0..floor((sqrt(1+8*n)-1)/2)), n=0..14);
    # second Maple program:
    b:= proc(n, i) option remember; expand(`if`(n=0, 1,
          `if`(i<1, 0, add(x^signum(j)*b(n-i*j, i-1)*
          combinat[multinomial](n, n-i*j, i$j), j=0..n/i))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n$2)):
    seq(T(n), n=0..14);
  • Mathematica
    multinomial[n_, k_List] := n!/Times @@ (k!);
    b[n_, i_] := b[n, i] = Expand[If[n == 0, 1, If[i<1, 0, Sum[x^Sign[j]*b[n - i*j, i-1]*multinomial[n, Join[{n-i*j}, Table[i, {j}]]], {j, 0, n/i}]]]];
    T[n_] := CoefficientList[b[n, n], x];
    T /@ Range[0, 14] // Flatten (* Jean-François Alcover, May 06 2020, after 2nd Maple program *)

Formula

T(n*(n+1)/2,n) = T(A000217(n),n) = A022915(n).

A087905 a(n) = n! * Sum_{d|n} (d/n)^d.

Original entry on oeis.org

1, 3, 8, 36, 144, 1010, 5760, 50400, 416640, 4250232, 43545600, 553106400, 6706022400, 95865541200, 1410695430144, 22720842144000, 376610217984000, 6888030445296000, 128047474114560000, 2587520533615041024
Offset: 1

Views

Author

Vladeta Jovovic, Oct 14 2003

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:= n!*DivisorSum[n, (#/n)^# &]; Array[a, 50] (* G. C. Greubel, May 16 2018 *)
  • PARI
    {a(n)= n!*sumdiv(n, d, (d/n)^d)};
    for(n=1, 30, print1(a(n), ", ")) \\ G. C. Greubel, May 16 2018

Formula

E.g.f.: Sum_{k>0} x^k/(k-x^k).

A306437 Regular triangle read by rows where T(n,k) is the number of non-crossing set partitions of {1, ..., n} in which all blocks have size k.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 2, 0, 1, 1, 0, 0, 0, 1, 1, 5, 3, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 14, 0, 4, 0, 0, 0, 1, 1, 0, 12, 0, 0, 0, 0, 0, 1, 1, 42, 0, 0, 5, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 132, 55, 22, 0, 6, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 429, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Gus Wiseman, Feb 15 2019

Keywords

Examples

			Triangle begins:
  1
  1   1
  1   0   1
  1   2   0   1
  1   0   0   0   1
  1   5   3   0   0   1
  1   0   0   0   0   0   1
  1  14   0   4   0   0   0   1
  1   0  12   0   0   0   0   0   1
  1  42   0   0   5   0   0   0   0   1
  1   0   0   0   0   0   0   0   0   0   1
  1 132  55  22   0   6   0   0   0   0   0   1
Row 6 counts the following non-crossing set partitions (empty columns not shown):
  {{1}{2}{3}{4}{5}{6}}  {{12}{34}{56}}  {{123}{456}}  {{123456}}
                        {{12}{36}{45}}  {{126}{345}}
                        {{14}{23}{56}}  {{156}{234}}
                        {{16}{23}{45}}
                        {{16}{25}{34}}
		

Crossrefs

Row sums are A194560. Column k=2 is A126120. Trisection of column k=3 is A001764.

Programs

  • Maple
    T:= (n, k)-> `if`(irem(n, k)=0, binomial(n, n/k)/(n-n/k+1), 0):
    seq(seq(T(n,k), k=1..n), n=1..14);  # Alois P. Heinz, Feb 16 2019
  • Mathematica
    Table[Table[If[Divisible[n,d],d/n*Binomial[n,n/d-1],0],{d,n}],{n,15}]

Formula

If d|n, then T(n, d) = binomial(n, n/d)/(n - n/d + 1); otherwise T(n, k) = 0 [Theorem 1 of Kreweras].
Showing 1-10 of 17 results. Next