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.

Previous Showing 11-13 of 13 results.

A158243 Derangements with at least one 2-cycle.

Original entry on oeis.org

0, 0, 1, 0, 3, 20, 105, 714, 5845, 52632, 525105, 5777090, 69337521, 901364100, 12618959353, 189284859750, 3028559357265, 51485499960944, 926738981188065, 17608040824708242, 352160816656099465, 7395377145973453980, 162698297211819995241, 3742060835955157848110
Offset: 0

Views

Author

Joerg Arndt, Mar 14 2009

Keywords

Examples

			There is just one derangement of 2 elements, it is a 2-cycle, so a(2)=1. The 2 derangements of 3 elements are cyclic shifts (3-cycles), so a(3)=0. The 9 derangements of 4 elements are (both array and cycle notation):
1: [ 1 0 3 2 ] (0, 1) (2, 3)
2: [ 1 2 3 0 ] (0, 1, 2, 3)
3: [ 1 3 0 2 ] (0, 1, 3, 2)
4: [ 2 0 3 1 ] (0, 2, 3, 1)
5: [ 2 3 0 1 ] (0, 2) (1, 3)
6: [ 2 3 1 0 ] (0, 2, 1, 3)
7: [ 3 0 1 2 ] (0, 3, 2, 1)
8: [ 3 2 0 1 ] (0, 3, 1, 2)
9: [ 3 2 1 0 ] (0, 3) (1, 2)
Of these, three (number 1, 5, and 9) contain a 2-cycle, so a(4)=3.
		

Crossrefs

Second row of A145877. Cf. A000166.

Programs

  • Maple
    a:= n-> coeff(series((1-exp(-x^2/2))*exp(-x)/(1-x), x, n+1), x, n)*n!:
    seq(a(n), n=0..25); # Alois P. Heinz, May 20 2013
    # second Maple program:
    a:= proc(n) option remember; `if`(n<4, n*(n-1)*(3-n)/2,
          ((n-1)*((n-3)*a(n-1) +(n-2)*(a(n-2)
          +(n-2)*a(n-3) +(n-3)*a(n-4))))/(n-2))
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, Aug 08 2013
  • Mathematica
    nn = 21; Rest[ Range[0, nn]! CoefficientList[ Series[(Exp[-x] - Exp[-x - x^2/2])/(1 - x), {x, 0, nn}], x]] (* Geoffrey Critzer, May 20 2013 *)
  • PARI
    N=25; z='x+O('x^N); k=2; v=Vec(serlaplace((1-exp(-z^k/k))* exp(-sum(j=1,k-1,z^j/j))/(1-x))) /* vector starting with index 2 */

Formula

E.g.f.: (1-exp(-x^2/2))*exp(-x)/(1-x).
a(n) ~ n! * (exp(-1)-exp(-3/2)). - Vaclav Kotesovec, Jul 30 2013

A178979 Triangular array read by rows: T(n,k) is the number of set partitions of {1,2,...,n} in which the shortest block has length k (1 <= k <= n).

Original entry on oeis.org

1, 1, 1, 4, 0, 1, 11, 3, 0, 1, 41, 10, 0, 0, 1, 162, 30, 10, 0, 0, 1, 715, 126, 35, 0, 0, 0, 1, 3425, 623, 56, 35, 0, 0, 0, 1, 17722, 2934, 364, 126, 0, 0, 0, 0, 1, 98253, 15165, 2220, 210, 126, 0, 0, 0, 0, 1, 580317, 86900, 10560, 330, 462, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Geoffrey Critzer, Jan 02 2011

Keywords

Comments

Row sums are Bell numbers A000110.
Column 1 is A000296 (shifted).
From Peter Luschny, Apr 05 2011: (Start)
Sum_{k>1} T(n,k) = A000296(n) count the set partitions with blocks of size > 1.
T(n,1) = A000296(n-1) count the set partitions with blocks of size = 1. Thus for the Bell numbers A000110(n) = Sum_{k>=1} T(n,k) = A000296(n-1) + A000296(n). (End)

Examples

			T(4,2) = card ({12|34, 13|24, 14|23}) = 3. - _Peter Luschny_, Apr 05 2011
Triangle begins:
    1;
    1,   1;
    4,   0,  1;
   11,   3,  0,  1;
   41,  10,  0,  0,  1;
  162,  30, 10,  0,  0,  1;
  715, 126, 35,  0,  0,  0,  1;
  ...
		

Crossrefs

Programs

  • Maple
    g := k-> exp(x)*(1-(GAMMA(k,x)/GAMMA(k))); egf := k-> exp(g(k))-exp(g(k+1));
    T := (n,k)-> n!*coeff(series(egf(k), x, n+1), x, n):
    seq(seq(T(n, k), k=1..n), n=1..9); # Peter Luschny, Apr 05 2011
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i>n, 0,
           add(b(n-i*j, i+1) *n!/i!^j/(n-i*j)!/j!, j=0..n/i)))
        end:
    T:= (n, k)-> b(n, k) -b(n, k+1):
    seq(seq(T(n, k), k=1..n), n=1..12);  # Alois P. Heinz, Mar 25 2016
  • Mathematica
    a[k_]:= Exp[x]-Sum[x^i/i!,{i,0,k}]; Transpose[Table[Range[20]! Rest[CoefficientList[Series[Exp[a[k-1]]-Exp[a[k]],{x,0,20}],x]],{k,1,9}]]//Grid

Formula

E.g.f. for column k: exp((exp(x) - Sum_{i=0..k-1} x^i/i!)) - exp((exp(x) - Sum_{i=0..k} x^i/i!)).
From Ludovic Schwob, Jan 15 2022: (Start)
T(2n,n) = A001700(n) = C(2n-1,n) for n>0.
T(2n-1,n-1) = A001700(n) = C(2n-1,n) for n>1. (End)

A348075 Triangular array read by rows: T(n,k) is the number of derangements whose shortest cycle has exactly k nodes; n >= 1, 1 <= k <= n.

Original entry on oeis.org

0, 0, 1, 0, 0, 2, 0, 3, 0, 6, 0, 20, 0, 0, 24, 0, 105, 40, 0, 0, 120, 0, 714, 420, 0, 0, 0, 720, 0, 5845, 2688, 1260, 0, 0, 0, 5040, 0, 52632, 22400, 18144, 0, 0, 0, 0, 40320, 0, 525105, 223200, 151200, 72576, 0, 0, 0, 0, 362880, 0, 5777090, 2522520, 1425600, 1330560, 0, 0, 0, 0, 0, 3628800
Offset: 1

Views

Author

Steven Finch, Sep 27 2021

Keywords

Comments

For the statistic "length of the longest cycle", see A211871.

Examples

			Triangle begins:
  0;
  0,     1;
  0,     0,     2;
  0,     3,     0,     6;
  0,    20,     0,     0,   24;
  0,   105,    40,     0,    0,  120;
  0,   714,   420,     0,    0,    0,  720;
  0,  5845,  2688,  1260,    0,    0,    0, 5040;
  0, 52632, 22400, 18144,    0,    0,    0,    0, 40320;
  ...
		

Crossrefs

Row sums give A000166, n >= 1.
Right border gives A000142.
Column 1 gives A000004.
Column 2 gives A158243.

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, x^m, add((j-1)!*
          b(n-j, min(m, j))*binomial(n-1, j-1), j=2..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n$2)):
    seq(T(n), n=1..12);  # Alois P. Heinz, Sep 27 2021
  • Mathematica
    b[n_, m_] := b[n, m] = If[n == 0, x^m, Sum[(j - 1)!*
         b[n - j, Min[m, j]]*Binomial[n - 1, j - 1], {j, 2, n}]];
    T[n_] := If[n == 1, {0}, CoefficientList[b[n, n], x] // Rest];
    Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Oct 03 2021, after Alois P. Heinz *)

Formula

T(n,n) = A000142(n-1), n >= 2.
T(n,2) = A158243(n), n >= 2.
T(n,k) = A145877(n,k) for k >= 2.
Previous Showing 11-13 of 13 results.