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 21 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

A055225 a(n) = Sum_{k divides n} (n/k)^k.

Original entry on oeis.org

1, 3, 4, 9, 6, 24, 8, 41, 37, 68, 12, 258, 14, 192, 384, 593, 18, 1557, 20, 2794, 2552, 2192, 24, 16730, 3151, 8388, 20440, 35394, 30, 116474, 32, 135457, 178512, 131396, 94968, 1111035, 38, 524688, 1596560, 2530986, 42, 7280934, 44, 8403778
Offset: 1

Views

Author

Leroy Quet, Jun 20 2000

Keywords

Comments

a(n) is the number of (nonempty) linear partitions of the linearly ordered set [n] = {1,2,...,n} with blocks of the same size, where each block has exactly one element marked. For instance, for n = 4, we have the following 9 linear partitions (where the marked elements are denoted by *):
. (*)(*)(*)(*), (*2)(*4), (*234),
. (*2)(3*), (1*34),
. (1*)(*4), (12*4),
. (1*)(3*), (123*).
- Emanuele Munarini, Feb 03 2014

Examples

			a(10) = 10^1 + 5^2 + 2^5 + 1^10 = 68 because positive divisors of 10 are 1, 2, 5, 10.
		

Crossrefs

Programs

  • Mathematica
    Table[Total[Quotient[n, x = Divisors[n]]^x], {n, 44}] (* Jayanta Basu, Jul 08 2013 *)
    Table[Sum[d^(n/d), {d, Divisors[n]}], {n, 1, 100}] (* Emanuele Munarini, Feb 03 2014 *)
  • Maxima
    a(n) := lsum(d^(n/d), d, listify(divisors(n))); makelist(a(n), n, 1, 40); /* Emanuele Munarini, Feb 03 2014 */
  • PARI
    vector(44, n, sumdiv(n, d, (n/d)^d))
    
  • PARI
    a(n) = sumdiv(n,d, d^(n/d) ); \\ Joerg Arndt, Apr 14 2013
    

Formula

G.f.: Sum_{n>=1} -log(1 - n*x^n)/n = Sum_{n>=0} a(n) x^n/n. - Paul D. Hanna, Aug 04 2002
G.f.: Sum_{n>0} n*x^n/(1-n*x^n). - Vladeta Jovovic, Sep 02 2002
Sum_{k=1..n} a(k) ~ 3^((n + 3 - mod(n,3))/3)/2. - Vaclav Kotesovec, Aug 07 2022

Extensions

More terms from James Sellers, Jul 04 2000
Duplicate g.f. removed by Franklin T. Adams-Watters, Sep 01 2009

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

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

A028417 Sum over all n! permutations of n elements of minimum lengths of cycles.

Original entry on oeis.org

1, 3, 10, 45, 236, 1505, 10914, 90601, 837304, 8610129, 96625970, 1184891081, 15665288484, 223149696601, 3394965018886, 55123430466945, 948479737691504, 17289345305870561, 332019600921360594, 6713316975465246889, 142321908843254560540, 3161718732648662557161
Offset: 1

Views

Author

Joe Keane (jgk(AT)jgk.org)

Keywords

Crossrefs

Cf. A005225.
Column k=1 of A322383.

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, m, add((j-1)!*
          b(n-j, min(m,j))*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> b(n, infinity):
    seq(a(n), n=1..25);  # Alois P. Heinz, May 14 2016
  • Mathematica
    Drop[Apply[Plus,Table[nn=25;Range[0,nn]!CoefficientList[Series[Exp[Sum[ x^i/i,{i,n,nn}]]-1,{x,0,nn}],x],{n,1,nn}]],1] (* Geoffrey Critzer, Jan 10 2013 *)
    b[n_, m_] := b[n, m] = If[n == 0, m, Sum[(j-1)! b[n-j, Min[m, j]]* Binomial[n-1, j-1], {j, n}]];
    a[n_] := b[n, Infinity];
    Array[a, 25] (* Jean-François Alcover, Apr 21 2020, after Alois P. Heinz *)

Formula

E.g.f.: Sum[k>0, -1+ exp(Sum(j>=k, x^j/j))]. - Vladeta Jovovic, Jul 26 2004
a(n) = Sum_{k=1..n} k * A145877(n,k). - Alois P. Heinz, Jul 28 2014

Extensions

More terms from Vladeta Jovovic, Sep 19 2002

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

Original entry on oeis.org

1, 0, 3, 2, 25, 94, 721, 3674, 42561, 291248, 3628801, 34254604, 479001601, 5337581534, 88966701825, 1140807642974, 20922789888001, 321094542593824, 6402373705728001, 109338195253235948, 2457732174030848001
Offset: 1

Views

Author

Vladeta Jovovic, Sep 06 2007

Keywords

Crossrefs

Programs

  • Mathematica
    Rest[ Range[0, 22]! CoefficientList[ Series[ - Sum[ Exp[ -x^k/k], {k, 25}], {x, 0, 22}], x]] (* Robert G. Wilson v, Sep 13 2007 *)
  • PARI
    a(n) = n!*sumdiv(n, d, (-1)^(d+1)/(d!*(n/d)^d)); \\ Michel Marcus, Sep 29 2017

Formula

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

Extensions

More terms from Robert G. Wilson v, Sep 13 2007

A236696 Number of forests on n vertices consisting of labeled rooted trees of the same size.

Original entry on oeis.org

1, 3, 10, 77, 626, 8707, 117650, 2242193, 43250842, 1049248991, 25937424602, 772559330281, 23298085122482, 817466439388341, 29223801257127976, 1181267018656911617, 48661191875666868482, 2232302772999145783735, 104127350297911241532842
Offset: 1

Views

Author

Emanuele Munarini, Jan 30 2014

Keywords

Examples

			For n = 3 we have the following 10 forests (where the roots are denoted by ^):
                              3  2  3  1  2  1
                              |  |  |  |  |  |
         2   3  1   3  1   2  2  3  1  3  1  2
          \ /    \ /    \ /   |  |  |  |  |  |
  1 2 3    1      2      3    1  1  2  2  3  3
  ^ ^ ^,   ^,     ^,     ^,   ^, ^, ^, ^, ^, ^
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[n!/(n/d)!*(d^(d-1)/d!)^(n/d), {d,Divisors[n]}], {n,1,100}]
  • Maxima
    a(n):= lsum(n!/(n/d)!*(d^(d-1)/d!)^(n/d),d,listify(divisors(n))); makelist(a(n),n,1,40); /* Emanuele Munarini, Feb 03 2014 */

Formula

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

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).

A346055 Expansion of e.g.f. Product_{k>=1} B(x^k/k) where B(x) = exp(exp(x) - 1) = e.g.f. of Bell numbers.

Original entry on oeis.org

1, 1, 3, 10, 47, 246, 1617, 11586, 97463, 891610, 9189623, 102024396, 1250714445, 16351489116, 232261545869, 3499469551402, 56582677946675, 964734301550142, 17509882651329087, 333381717125596692, 6710286637806825557, 141167551783524139468
Offset: 0

Views

Author

Seiichi Manyama, Jul 02 2021

Keywords

Crossrefs

Programs

  • PARI
    my(N=40, x='x+O('x^N)); Vec(serlaplace(prod(k=1, N, exp(exp(x^k/k)-1))))
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(serlaplace(exp(sum(k=1, N, exp(x^k/k)-1))))
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(serlaplace(exp(sum(k=1, N, sumdiv(k, d, 1/(d!*(k/d)^d))*x^k))))
    
  • PARI
    a(n) = if(n==0, 1, (n-1)!*sum(k=1, n, k*sumdiv(k, d, 1/(d!*(k/d)^d))*a(n-k)/(n-k)!));

Formula

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

A241980 Number of endofunctions on [n] where all cycle lengths are equal.

Original entry on oeis.org

1, 1, 4, 24, 206, 2300, 31742, 522466, 9996478, 218088504, 5344652492, 145386399554, 4347272984936, 141737636485588, 5004538251283846, 190247639729155110, 7747479351505166738, 336492490519027631984, 15526758954835131888980, 758548951300064645742034
Offset: 0

Views

Author

Alois P. Heinz, Aug 10 2014

Keywords

Crossrefs

Cf. A005225, A061356, A212789, A242027 (column k=1).
Row sums of A243098.

Programs

  • Maple
    with(numtheory):
    b:= n-> `if`(n=0, 1, n!*add((d!*(n/d)^d)^(-1), d=divisors(n))):
    a:= n-> add(binomial(n-1, j-1)*n^(n-j)*b(j), j=0..n):
    seq(a(n), n=0..25);
  • Mathematica
    nn=20;t[x_]:=Sum[n^(n-1)x^n/n!,{n,1,nn}];Range[0,nn]!CoefficientList[Series[1+Sum[Exp[t[x]^i/i]-1,{i,1,nn}],{x,0,nn}],x] (* Geoffrey Critzer, Aug 11 2014 *)

Formula

a(n) = Sum_{j=0..n} C(n-1,j-1) * n^(n-j) * A005225(j).
a(n) = Sum_{k=0..n} A243098(n,k).
Showing 1-10 of 21 results. Next