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-3 of 3 results.

A114320 Triangle T(n,k) = number of permutations of n elements with k 2-cycles.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 15, 6, 3, 75, 30, 15, 435, 225, 45, 15, 3045, 1575, 315, 105, 24465, 12180, 3150, 420, 105, 220185, 109620, 28350, 3780, 945, 2200905, 1100925, 274050, 47250, 4725, 945, 24209955, 12110175, 3014550, 519750, 51975, 10395, 290529855
Offset: 0

Views

Author

Vladeta Jovovic, Feb 05 2006

Keywords

Comments

Row n has 1+floor(n/2) terms. Row sums yield the factorials (A000142). Sum(k*T(n,k),k>0)=n!/2 for n>=2. - Emeric Deutsch, Feb 17 2006

Examples

			T(3,1) = 3 because we have (1)(23), (12)(3) and (13)(2).
Triangle begins:
    1;
    1;
    1,   1;
    3,   3;
   15,   6,   3;
   75,  30,  15;
  435, 225,  45,  15;
  ...
		

Crossrefs

Programs

  • Maple
    G:= exp((y-1)*x^2/2)/(1-x): Gser:= simplify(series(G,x=0,15)): P[0]:=1: for n from 1 to 12 do P[n]:= n!*coeff(Gser,x^n) od: for n from 0 to 12 do seq(coeff(y*P[n], y^j), j=1..1+floor(n/2)) od;  # yields sequence in triangular form - Emeric Deutsch, Feb 17 2006
  • Mathematica
    d = Exp[-x^2/2!]/(1 - x);f[list_] := Select[list, # > 0 &]; Flatten[Map[f, Transpose[Table[Range[0, 10]!CoefficientList[Series[x^(2 k)/(2^k k!) d, {x, 0, 10}], x], {k, 0, 5}]]]]  (* Geoffrey Critzer, Nov 29 2011 *)

Formula

E.g.f.: exp((y-1)*x^2/2)/(1-x). More generally, e.g.f. for number of permutations of n elements with k m-cycles is exp((y-1)*x^m/m)/(1-x).
T(n,k) = n!/(2^k*k!) * Sum_{j=0..floor(n/2)-k} (-1/2)^j/j!. - Alois P. Heinz, Nov 30 2011

Extensions

More terms from Emeric Deutsch, Feb 17 2006

A027616 Number of permutations of n elements containing a 2-cycle.

Original entry on oeis.org

0, 0, 1, 3, 9, 45, 285, 1995, 15855, 142695, 1427895, 15706845, 188471745, 2450132685, 34301992725, 514529890875, 8232476226975, 139952095858575, 2519137759913775, 47863617438361725, 957272348112505425, 20102719310362613925, 442259824841726816925, 10171975971359716789275
Offset: 0

Views

Author

Joe Keane (jgk(AT)jgk.org)

Keywords

Crossrefs

Column k=2 of A293211.

Programs

  • Magma
    A027616:= func< n | Factorial(n)*(1- (&+[(-1/2)^j/Factorial(j): j in [0..Floor(n/2)]]) ) >;
    [A027616(n): n in [0..30]]; // G. C. Greubel, Aug 05 2022
    
  • Maple
    S:= series((1-exp(-x^2/2))/(1-x), x, 101):
    seq(coeff(S,x,j)*j!,j=0..100); # Robert Israel, May 12 2016
  • Mathematica
    nn=30; Table[n!,{n,0,nn}]-Range[0,nn]!CoefficientList[Series[Exp[-x^2/2]/(1-x),{x,0,nn}],x]  (* Geoffrey Critzer, Oct 20 2012 *)
  • PARI
    a(n) = n! * (1 - sum(k=0,floor(n/2), (-1)^k / (2^k * k!) ) );
    /* Joerg Arndt, Oct 20 2012 */
    
  • PARI
    N=33; x='x+O('x^N);
    v=Vec( 'a0 + serlaplace( (1-exp(-x^2/2))/(1-x) ) );
    v[1]-='a0;  v
    /* Joerg Arndt, Oct 20 2012 */
    
  • SageMath
    def A027616(n): return factorial(n)*(1-sum((-1/2)^k/factorial(k) for k in (0..(n//2))))
    [A027616(n) for n in (0..30)] # G. C. Greubel, Aug 05 2022

Formula

E.g.f.: (1 - exp(-x^2/2)) / (1-x).
a(n) = n! * ( 1 - Sum_{k=0..floor(n/2)} (-1)^k / (2^k * k!) ).
a(n) + A000266(n) = n!. - Yuval Dekel (dekelyuval(AT)hotmail.com), Nov 09 2003
Limit_{n -> oo} a(n)/n! = 1 - e^(-1/2) = 1 - A092605. - Michel Marcus, Aug 08 2013

Extensions

Added more terms, Geoffrey Critzer, Oct 20 2012

A178669 The number of permutations of [n] with 2 cycles of length 2.

Original entry on oeis.org

0, 3, 15, 45, 315, 3150, 28350, 274050, 3014550, 36330525, 472296825, 6609317715, 99139765725, 1586293008300, 26966981141100, 485404420000500, 9222683980009500, 184453709062998375
Offset: 3

Views

Author

Paul Weisenhorn, Jun 02 2010

Keywords

Examples

			a(4)=3 counts the 3 permutations (2143), (3412), (4321) with 2 cycles
of length 2
		

Crossrefs

Cf. A088436 (k=1 cycle), A000266 (k=0 cycle).

Programs

  • Maple
    A178669 := proc(n) local k ; k :=2 ; n!*add( (-1)^j/(j-k)!/2^j/k!,j=k..n/2) ; end proc:
    seq(A178669(n),n=3..20) ;
  • Mathematica
    d=Exp[-x^2/2]/(1-x); Range[0,20]! CoefficientList[Series[(3x^4/4! )d, {x,0,20}], x] (* Geoffrey Critzer, Nov 29 2011 *)

Formula

a(n)=n!*sum_{j=k.. [n/2]} (-1)^j/((j-k)!*2^j*k!). E.g.f. = exp(-z^2/2)*z^(2*k) / ((1-z)*2^k*k!), where k is the number of cycles of length 2.
a(n) ~ n! * exp(-1/2)/8. - Vaclav Kotesovec, Mar 20 2014

Extensions

Typo in a(18) corrected by Vincenzo Librandi, Mar 21 2014
Showing 1-3 of 3 results.