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

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

A005225 Number of permutations of length n with equal cycles.

Original entry on oeis.org

1, 2, 3, 10, 25, 176, 721, 6406, 42561, 436402, 3628801, 48073796, 479001601, 7116730336, 88966701825, 1474541093026, 20922789888001, 400160588853026, 6402373705728001, 133991603578884052, 2457732174030848001, 55735573291977790576, 1124000727777607680001
Offset: 1

Views

Author

Keywords

Examples

			For example, a(4)=10 since, of the 24 permutations of length 4, there are 6 permutations with consist of a single 4-cycle, 3 permutations that consist of two 2-cycles and 1 permutation with four 1-cycles.
Also, a(7)=721 since there are 720 permutations with a single cycle of length 7 and 1 permutation with seven 1-cycles.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • D. P. Walsh, A differentiation-based characterization of primes, Abstracts Amer. Math. Soc., 25 (No. 2, 2002), p. 339, #975-11-237.

Crossrefs

Column k=1 of A218868.
Column k=0 of A364967 (for n>=1).

Programs

  • Maple
    a:= n-> n!*add((d/n)^d/d!, d=numtheory[divisors](n)):
    seq(a(n), n=1..30);  # Alois P. Heinz, Nov 07 2012
  • Mathematica
    Table[n! Sum[((n/d)!*d^(n/d))^(-1), {d, Divisors[n]}], {n, 21}] (* Jean-François Alcover, Apr 04 2011 *)
  • Maxima
    a(n):= n!*lsum((d!*(n/d)^d)^(-1),d,listify(divisors(n)));
    makelist(a(n),n,1,40); /* Emanuele Munarini, Feb 03 2014 */

Formula

a(n) = n!*sum(((n/k)!*k^(n/k))^(-1)) where sum is over all divisors k of n. Exponential generating function [for a(1) through a(n)]= sum(exp(t^k/k)-1, k=1..n).
a(n) = (n-1)! + 1 iff n is a prime.

Extensions

Additional comments from Dennis P. Walsh, Dec 08 2000
More terms from Vladeta Jovovic, Dec 01 2001

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

A073705 a(n) = Sum_{ d divides n } (n/d)^(2d).

Original entry on oeis.org

1, 5, 10, 33, 26, 182, 50, 577, 811, 1750, 122, 16194, 170, 18982, 74900, 135425, 290, 847127, 362, 2498178, 4901060, 4209430, 530, 78564226, 9766251, 67138102, 387952660, 542674914, 842, 4866184552, 962, 8606778369, 31382832260, 17179953862, 6385992100, 422091411267, 1370, 274878038710
Offset: 1

Views

Author

Paul D. Hanna, Aug 04 2002

Keywords

Comments

a(n) is the number of linear partitions of the linearly ordered set [n] = {1,2,...,n} with blocks of the same size, where each block has two element marked (possibly equal). For instance, for n = 3, we have the following 10 linear partitions (where the marked elements are denoted by a and b, or by X when they coincide):
(X)(X)(X), (ab3), (a2b), (1ab), (ba3), (b2a), (1ba), (X23), (1X3), (12X). - Emanuele Munarini, Feb 03 2014

Examples

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

Crossrefs

Programs

  • Mathematica
    Table[Total[Quotient[n, x = Divisors[n]]^(2*x)], {n, 34}] (* Jayanta Basu, Jul 08 2013 *)
  • Maxima
    a(n):= lsum(d^(2*n/d),d,listify(divisors(n)));
    makelist(a(n),n,1,40); /* Emanuele Munarini , Feb 03 2014 */
  • PARI
    a(n)=sumdiv(n, d, (d)^(2*n/d) );  /* Joerg Arndt, Oct 07 2012 */
    

Formula

G.f.: Sum_{n>=1} -log(1 - (n^2)*x^n)/n = Sum_{n>=1} a(n) x^n/n.
G.f.: Sum_{k>=1} k^2*x^k/(1-k^2*x^k). - Benoit Cloitre, Apr 21 2003

Extensions

Corrected a(14) and inserted missing a(16) by Jayanta Basu, Jul 08 2013

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

A326374 Irregular triangle read by rows where T(n,k) is the number of (d + 1)-uniform hypertrees spanning n + 1 vertices, where d = A027750(n,k).

Original entry on oeis.org

1, 3, 1, 16, 1, 125, 15, 1, 1296, 1, 16807, 735, 140, 1, 262144, 1, 4782969, 76545, 1890, 1, 100000000, 112000, 1, 2357947691, 13835745, 33264, 1, 61917364224, 1, 1792160394037, 3859590735, 270670400, 35135100, 720720, 1, 56693912375296, 1, 1946195068359375
Offset: 1

Views

Author

Gus Wiseman, Jul 03 2019

Keywords

Comments

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

Examples

			Triangle begins:
           1
           3          1
          16          1
         125         15          1
        1296          1
       16807        735        140          1
      262144          1
     4782969      76545       1890          1
   100000000     112000          1
  2357947691   13835745      33264          1
The T(4,2) = 15 hypertrees:
  {{1,4,5},{2,3,5}}
  {{1,4,5},{2,3,4}}
  {{1,3,5},{2,4,5}}
  {{1,3,5},{2,3,4}}
  {{1,3,4},{2,4,5}}
  {{1,3,4},{2,3,5}}
  {{1,2,5},{3,4,5}}
  {{1,2,5},{2,3,4}}
  {{1,2,5},{1,3,4}}
  {{1,2,4},{3,4,5}}
  {{1,2,4},{2,3,5}}
  {{1,2,4},{1,3,5}}
  {{1,2,3},{3,4,5}}
  {{1,2,3},{2,4,5}}
  {{1,2,3},{1,4,5}}
		

Crossrefs

Programs

  • Maple
    T:= n-> seq(n!/(d!*(n/d)!)*((n+1)/d)^(n/d-1), d=numtheory[divisors](n)):
    seq(T(n), n=1..20);  # Alois P. Heinz, Aug 21 2019
  • Mathematica
    Table[n!/(d!*(n/d)!)*((n+1)/d)^(n/d-1),{n,10},{d,Divisors[n]}]

Formula

T(n, k) = n!/(d! * (n/d)!) * ((n + 1)/d)^(n/d - 1), where d = A027750(n, k).

Extensions

Edited by Peter Munn, Mar 05 2025
Showing 1-8 of 8 results.