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 11 results. Next

A126074 Triangle read by rows: T(n,k) is the number of permutations of n elements that have the longest cycle length k.

Original entry on oeis.org

1, 1, 1, 1, 3, 2, 1, 9, 8, 6, 1, 25, 40, 30, 24, 1, 75, 200, 180, 144, 120, 1, 231, 980, 1260, 1008, 840, 720, 1, 763, 5152, 8820, 8064, 6720, 5760, 5040, 1, 2619, 28448, 61236, 72576, 60480, 51840, 45360, 40320, 1, 9495, 162080, 461160, 653184, 604800, 518400, 453600, 403200, 362880
Offset: 1

Views

Author

Dan Dima, Mar 01 2007

Keywords

Comments

Sum of the n-th row is the number of all permutations of n elements: Sum_{k=1..n, T(n,k)} = n! = A000142(n) We can extend T(n,k)=0, if k<=0 or k>n.
From Peter Luschny, Mar 07 2009: (Start)
Partition product of prod_{j=0..n-2}(k-n+j+2) and n! at k = -1, summed over parts with equal biggest part (see the Luschny link).
Underlying partition triangle is A102189.
Same partition product with length statistic is A008275.
Diagonal a(A000217(n)) = rising_factorial(1,n-1), A000142(n-1) (n > 0).
Row sum is A000142. (End)
Let k in {1,2,3,...} index the family of sequences A000012, A000085, A057693, A070945, A070946, A070947, ... respectively. Column k is the k-th sequence minus its immediate predecessor. For example, T(5,3)=A057693(5)-A000085(5). - Geoffrey Critzer, May 23 2009

Examples

			Triangle T(n,k) begins:
  1;
  1,   1;
  1,   3,    2;
  1,   9,    8,    6;
  1,  25,   40,   30,   24;
  1,  75,  200,  180,  144,  120;
  1, 231,  980, 1260, 1008,  840,  720;
  1, 763, 5152, 8820, 8064, 6720, 5760, 5040;
  ...
		

Crossrefs

Cf. A000142.
T(2n,n) gives A052145 (for n>0). - Alois P. Heinz, Apr 21 2017

Programs

  • Maple
    A:= proc(n,k) option remember; `if`(n<0, 0, `if`(n=0, 1,
           add(mul(n-i, i=1..j-1)*A(n-j,k), j=1..k)))
        end:
    T:= (n, k)-> A(n, k) -A(n, k-1):
    seq(seq(T(n,k), k=1..n), n=1..10);  # Alois P. Heinz, Feb 11 2013
  • Mathematica
    Table[CoefficientList[ Series[(Exp[x^m/m] - 1) Exp[Sum[x^k/k, {k, 1, m - 1}]], {x, 0, 8}], x]*Table[n!, {n, 0, 8}], {m, 1, 8}] // Transpose // Grid (* Geoffrey Critzer, May 23 2009 *)
  • Sage
    def A126074(n, k):
        f = factorial(n)
        P = Partitions(n, max_part=k, inner=[k])
        return sum(f // p.aut() for p in P)
    for n in (1..9): print([A126074(n,k) for k in (1..n)]) # Peter Luschny, Apr 17 2016

Formula

T(n,1) = 1.
T(n,2) = n! * Sum_{k=1..[n/2]} 1/(k! * (2!)^k * (n-2*k)!).
T(n,k) = n!/k * (1-1/(n-k)-...-1/(k+1)-1/2k), if n/3 < k <= n/2.
T(n,k) = n!/k, if n/2 < k <= n.
T(n,n) = (n-1)! = A000142(n-1).
E.g.f. for k-th column: exp(-x^k*LerchPhi(x,1,k))*(exp(x^k/k)-1)/(1-x). - Vladeta Jovovic, Mar 03 2007
From Peter Luschny, Mar 07 2009: (Start)
T(n,0) = [n = 0] (Iverson notation) and for n > 0 and 1 <= m <= n
T(n,m) = Sum_{a} M(a)|f^a| where a = a_1,..,a_n such that
1*a_1+2*a_2+...+n*a_n = n and max{a_i} = m, M(a) = n!/(a_1!*..*a_n!),
f^a = (f_1/1!)^a_1*..*(f_n/n!)^a_n and f_n = product_{j=0..n-2}(j-n+1). (End)
Sum_{k=1..n} k * T(n,k) = A028418(n). - Alois P. Heinz, May 17 2016

A322384 Number T(n,k) of entries in the k-th cycles of all permutations of [n] when cycles are ordered by decreasing lengths (and increasing smallest elements); triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 3, 1, 13, 4, 1, 67, 21, 7, 1, 411, 131, 46, 11, 1, 2911, 950, 341, 101, 16, 1, 23563, 7694, 2871, 932, 197, 22, 1, 213543, 70343, 26797, 9185, 2311, 351, 29, 1, 2149927, 709015, 275353, 98317, 27568, 5119, 583, 37, 1, 23759791, 7867174, 3090544, 1141614, 343909, 73639, 10366, 916, 46, 1
Offset: 1

Views

Author

Alois P. Heinz, Dec 05 2018

Keywords

Examples

			The 6 permutations of {1,2,3} are:
  (1)     (2) (3)
  (1,2)   (3)
  (1,3)   (2)
  (2,3)   (1)
  (1,2,3)
  (1,3,2)
so there are 13 elements in the first cycles, 4 in the second cycles and only 1 in the third cycles.
Triangle T(n,k) begins:
       1;
       3,     1;
      13,     4,     1;
      67,    21,     7,    1;
     411,   131,    46,   11,    1;
    2911,   950,   341,  101,   16,   1;
   23563,  7694,  2871,  932,  197,  22,  1;
  213543, 70343, 26797, 9185, 2311, 351, 29, 1;
  ...
		

Crossrefs

Row sums give A001563.
T(2n,n) gives A332928.

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, add(l[-i]*
          x^i, i=1..nops(l)), add(binomial(n-1, j-1)*
          b(n-j, sort([l[], j]))*(j-1)!, j=1..n))
        end:
    T:= n-> (p-> (seq(coeff(p, x, i), i=1..n)))(b(n, [])):
    seq(T(n), n=1..12);
  • Mathematica
    b[n_, l_] := b[n, l] = If[n == 0, Sum[l[[-i]]*x^i, {i, 1, Length[l]}], Sum[Binomial[n-1, j-1]*b[n-j, Sort[Append[l, j]]]*(j-1)!, {j, 1, n}]];
    T[n_] := CoefficientList[b[n, {}], x] // Rest;
    Array[T, 12] // Flatten  (* Jean-François Alcover, Feb 26 2020, after Alois P. Heinz *)

A060014 Sum of orders of all permutations of n letters.

Original entry on oeis.org

1, 1, 3, 13, 67, 471, 3271, 31333, 299223, 3291487, 39020911, 543960561, 7466726983, 118551513523, 1917378505407, 32405299019941, 608246253790591, 12219834139189263, 253767339725277823, 5591088918313739017, 126036990829657056711, 2956563745611392385211
Offset: 0

Views

Author

N. J. A. Sloane, Mar 17 2001

Keywords

Comments

Conjecture: This sequence eventually becomes cyclic mod n for all n. - Isaac Saffold, Dec 01 2019

Examples

			For n = 4 there is 1 permutation of order 1, 9 permutations of order 2, 8 of order 3 and 6 of order 4, for a total of 67.
		

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section XIII.2, p. 460.

Crossrefs

Programs

  • Maple
    b:= proc(n, g) option remember; `if`(n=0, g, add((j-1)!
          *b(n-j, ilcm(g, j))*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jul 11 2017
  • Mathematica
    CoefficientList[Series[Sum[n Fold[#1+MoebiusMu[n/#2] Apply[Times, Exp[x^#/#]&/@Divisors[#2] ]&,0,Divisors[n]],{n,Max[Apply[LCM,Partitions[19],1]]}],{x,0,19}],x] Range[0,19]! (* Wouter Meeussen, Jun 16 2012 *)
    a[ n_] := If[ n < 1, Boole[n == 0], 1 + Total @ Apply[LCM, Map[Length, First /@ PermutationCycles /@ Drop[Permutations @ Range @ n, 1], {2}], 1]]; (* Michael Somos, Aug 19 2018 *)
  • PARI
    \\ Naive method -- sum over cycles directly
    cycleDecomposition(v:vec)={
        my(cyc=List(), flag=#v+1, n);
        while((n=vecmin(v))<#v,
            my(cur=List(), i, tmp);
            while(v[i++]!=n,);
            while(v[i] != flag,
                listput(cur, tmp=v[i]);
                v[i]=flag;
                i=tmp
            );
            if(#cur>1, listput(cyc, Vec(cur)))    \\ Omit length-1 cycles
        );
        Vec(cyc)
    };
    permutationOrder(v:vec)={
        lcm(apply(length, cycleDecomposition(v)))
    };
    a(n)=sum(i=0,n!-1,permutationOrder(numtoperm(n,i)))
    \\ Charles R Greathouse IV, Nov 06 2014
    
  • PARI
    A060014(n) =
    {
      my(factn = n!, part, nb, i, j, res = 0);
      forpart(part = n,
        nb = 1; j = 1;
        for(i = 1, #part,
          if (i == #part || part[i + 1] != part[i],
            nb *= (i + 1 - j)! * part[i]^(i + 1 - j);
            j = i + 1));
        res += (factn / nb) * lcm(Vec(part)));
      res;
    } \\ Jerome Raulin, Jul 11 2017 (much faster, O(A000041(n)) vs O(n!))

Formula

E.g.f.: Sum_{n>0} (n*Sum_{i|n} (moebius(n/i)*Product_{j|i} exp(x^j/j))). - Vladeta Jovovic, Dec 29 2004; The sum over n should run to at least A000793(k) for producing the k-th entry. - Wouter Meeussen, Jun 16 2012
a(n) = Sum_{k>=1} k* A057731(n,k). - R. J. Mathar, Aug 31 2017

Extensions

More terms from Vladeta Jovovic, Mar 18 2001
More terms from Alois P. Heinz, Feb 14 2013

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

A097147 Total sum of minimum block sizes in all partitions of n-set.

Original entry on oeis.org

1, 3, 7, 21, 66, 258, 1079, 4987, 25195, 136723, 789438, 4863268, 31693715, 217331845, 1564583770, 11795630861, 92833623206, 760811482322, 6479991883525, 57256139503047, 523919025038279, 4956976879724565, 48424420955966635, 487810283307069696
Offset: 1

Views

Author

Vladeta Jovovic, Jul 27 2004

Keywords

Crossrefs

Programs

  • Maple
    g:= proc(n, i, p) option remember; `if`(n=0, (i+1)*p!,
          `if`(i<1, 0, add(g(n-i*j, i-1, p+j*i)/j!/i!^j, j=0..n/i)))
        end:
    a:= n-> g(n$2, 0):
    seq(a(n), n=1..30);  # Alois P. Heinz, Mar 06 2015
  • 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 *)
    g[n_, i_, p_] := g[n, i, p] = If[n == 0, (i+1)*p!, If[i<1, 0,
         Sum[g[n-i*j, i-1, p+j*i]/j!/i!^j, {j, 0, n/i}]]];
    a[n_] := g[n, n, 0];
    Array[a, 30] (* Jean-François Alcover, Aug 24 2021, after Alois P. Heinz *)

Formula

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

Extensions

More terms from Max Alekseyev, Apr 29 2010

A097148 Total sum of maximum block sizes in all partitions of n-set.

Original entry on oeis.org

1, 3, 10, 35, 136, 577, 2682, 13435, 72310, 414761, 2524666, 16239115, 109976478, 781672543, 5814797281, 45155050875, 365223239372, 3070422740989, 26780417126048, 241927307839731, 2260138776632752, 21805163768404127, 216970086170175575, 2224040977932468379
Offset: 1

Views

Author

Vladeta Jovovic, Jul 27 2004

Keywords

Comments

Let M be the infinite lower triangular matrix given by A080510 and v the column vector [1,2,3,...] then M*v=A097148 (this sequence, as column vector). - Gary W. Adamson, Feb 24 2011

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, m, add(
          b(n-j, max(j, m))*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=1..24);  # Alois P. Heinz, Mar 02 2020, revised May 08 2024
  • Mathematica
    Drop[ Range[0, 22]! CoefficientList[ Series[ Sum[E^(E^x - 1) - E^Sum[x^j/j!, {j, 1, k}], {k, 0, 22}], {x, 0, 22}], x], 1] (* Robert G. Wilson v, Aug 05 2004 *)

Formula

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

Extensions

More terms from Robert G. Wilson v, Aug 05 2004

A097145 Total sum of minimum list sizes in all sets of lists of n-set, cf. A000262.

Original entry on oeis.org

0, 1, 5, 25, 157, 1101, 9211, 85513, 900033, 10402633, 133059331, 1836961941, 27619253113, 444584808253, 7678546353843, 140944884572521, 2751833492404321, 56691826303303953, 1233793951629951043, 28191548364561422173, 676190806704598883241
Offset: 0

Views

Author

Vladeta Jovovic, Jul 27 2004

Keywords

Examples

			For n=4 we have 73 sets of lists (cf. A000262): (1234) (24 ways), (123)(4) (6*4 ways), (12)(34) (3*4 ways), (12)(3)(4) (6*2 ways), (1)(2)(3)(4) (1 way); so a(n)= 24*4+24*1+12*2+12*1+1*1 = 157.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, m, add(j!*
          b(n-j, min(m, j))*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> `if`(n=0, 0, b(n, infinity)):
    seq(a(n), n=0..25);  # Alois P. Heinz, May 10 2016
  • Mathematica
    b[n_, m_] := b[n, m] = If[n==0, m, Sum[j!*b[n-j, Min[m, j]]*Binomial[n-1, j - 1], {j, 1, n}]]; a[n_] := If[n==0, 0, b[n, Infinity]]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 18 2017, after Alois P. Heinz *)

Formula

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

Extensions

More terms from Max Alekseyev, Jul 04 2009
a(0)=0 prepended by Alois P. Heinz, May 10 2016

A232193 Numerators of the expected value of the length of a random cycle in a random n-permutation.

Original entry on oeis.org

1, 3, 23, 55, 1901, 4277, 198721, 16083, 14097247, 4325321, 2132509567, 4527766399, 13064406523627, 905730205, 13325653738373, 362555126427073, 14845854129333883, 57424625956493833, 333374427829017307697, 922050973293317, 236387355420350878139797
Offset: 1

Views

Author

Geoffrey Critzer, Nov 20 2013

Keywords

Comments

In this experiment we randomly select (uniform distribution) an n-permutation and then randomly select one of the cycles from that permutation. Cf. A102928/A175441 which gives the expected cycle length when we simply randomly select a cycle.

Examples

			Expectations for n=1,... are 1/1, 3/2, 23/12, 55/24, 1901/720, 4277/1440, 198721/60480, 16083/4480, ... = A232193/A232248
For n=3 there are 6 permutations.  We have probability 1/6 of selecting (1)(2)(3) and the cycle size is 1.  We have probability 3/6 of selecting a permutation with cycle type (1)(23) and (on average) the cycle length is 3/2.  We have probability 2/6 of selecting a permutation of the form (123) and the cycle size is 3.  1/6*1 + 3/6*3/2 + 2/6*3 = 23/12.
		

Crossrefs

Denominators are A232248.
Cf. A028417(n)/n! the expected value of the length of the shortest cycle in a random n-permutation.
Cf. A028418(n)/n! the expected value of the length of the longest cycle in a random n-permutation.

Programs

  • Maple
    with(combinat):
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          expand(add(multinomial(n, n-i*j, i$j)/j!*(i-1)!^j
          *b(n-i*j, i-1) *x^j, j=0..n/i))))
        end:
    a:= n->numer((p->add(coeff(p, x, i)/i, i=1..n))(b(n$2))/(n-1)!):
    seq(a(n), n=1..30);  # Alois P. Heinz, Nov 21 2013
    # second Maple program:
    a:= n-> numer(add(abs(combinat[stirling1](n, i))/i, i=1..n)/(n-1)!):
    seq(a(n), n=1..30);  # Alois P. Heinz, Nov 23 2013
  • Mathematica
    Table[Numerator[Total[Map[Total[#]!/Product[#[[i]],{i,1,Length[#]}]/Apply[Times,Table[Count[#,k]!,{k,1,Max[#]}]]/(Total[#]-1)!/Length[#]&,Partitions[n]]]],{n,1,25}]

Formula

a(n) = Numerator( 1/(n-1)! * Sum_{i=1..n} A132393(n,i)/i ). - Alois P. Heinz, Nov 23 2013
a(n) = numerator(Sum_{k=0..n} A002657(k)/A091137(k)) (conjectured). - Michel Marcus, Jul 19 2019

A097146 Total sum of maximum list sizes in all sets of lists of n-set, cf. A000262.

Original entry on oeis.org

0, 1, 5, 31, 217, 1781, 16501, 172915, 1998641, 25468777, 352751941, 5292123431, 85297925065, 1472161501981, 27039872306357, 527253067633531, 10865963240550241, 236088078855319505, 5390956470528548101, 129102989125943058607, 3234053809095307670201, 84596120521251178630981, 2305894874979300173268085
Offset: 0

Views

Author

Vladeta Jovovic, Jul 27 2004

Keywords

Examples

			For n=4 we have 73 sets of lists (cf. A000262): (1234) (24 ways), (123)(4) (6*4 ways), (12)(34) (3*4 ways), (12)(3)(4) (6*2 ways), (1)(2)(3)(4) (1 way); so a(4)= 24*4+24*3+12*2+12*2+1*1 = 217.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, m, add(j!*
          b(n-j, max(m, j))*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..25);  # Alois P. Heinz, May 10 2016
  • Mathematica
    b[n_, m_] := b[n, m] = If[n == 0, m, Sum[j! b[n-j, Max[m, j]] Binomial[n-1, j-1], {j, 1, n}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 25] (* Jean-François Alcover, Nov 05 2020, after Alois P. Heinz *)
  • PARI
    N=50; x='x+O('x^N);
    egf=exp(x/(1-x))*sum(k=1,N, (1-exp(x^k/(x-1))) );
    Vec( serlaplace(egf) ) /* show terms */

Formula

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

Extensions

a(0)=0 prepended by Alois P. Heinz, May 10 2016

A208248 Sum of the maximum cycle length over all functions f:{1,2,...,n} -> {1,2,...,n} (endofunctions).

Original entry on oeis.org

0, 1, 5, 40, 431, 5826, 94657, 1795900, 38963535, 951398890, 25819760021, 770959012704, 25117397416795, 886626537549130, 33708625339151505, 1373237757290215156, 59677939242566840303, 2755753623830236494930, 134746033233724391374765, 6954962673986411576581000
Offset: 0

Views

Author

Geoffrey Critzer, Jan 12 2013

Keywords

Comments

a(n) is also the sum of the number of endofunctions with at least one cycle >= i for all i >= 1. In other words, a(n) = A000312(n) + A101334(n) + A208240(n) + ... .

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, m, add((j-1)!*
          b(n-j, max(m, j))*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> add(b(j, 0)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);  # Alois P. Heinz, May 20 2016
  • Mathematica
    nn=20; t=Sum[n^(n-1)x^n/n!, {n,1,nn}]; Apply[Plus, Table[Range[0,nn]! CoefficientList[Series[1/(1-t) - Exp[Sum[t^i/i, {i,1,n}]], {x,0,nn}], x], {n, 0, nn-1}]]

Formula

E.g.f.: Sum_{k>=0} 1/(1-T(x)) - exp(Sum_{i=1...k} T(x)^i/i) = A(T(x)) where A(x) is the e.g.f. for A028418 and T(x) is the e.g.f. for A000169.
Showing 1-10 of 11 results. Next