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.

A138772 Number of entries in the second cycles of all permutations of {1,2,...,n}; each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Original entry on oeis.org

0, 1, 5, 27, 168, 1200, 9720, 88200, 887040, 9797760, 117936000, 1536796800, 21555072000, 323805081600, 5187108326400, 88268019840000, 1590132031488000, 30233431388160000, 605024315191296000, 12711912992722944000, 279783730940313600000, 6437458713635389440000
Offset: 1

Views

Author

Emeric Deutsch, Apr 10 2008

Keywords

Examples

			a(3) = 5 because the number of entries in the second cycles of (1)(2)(3), (1)(23), (132), (12)(3), (123) and (13)(2) is 1+2+0+1+0+1=5.
		

Crossrefs

Cf. A138771.
Column k=2 of A185105.

Programs

  • GAP
    List([1..30], n-> (n-1)*(n+2)*Factorial(n-1)/4); # G. C. Greubel, Jul 07 2019
  • Magma
    [(n-1)*(n+2)*Factorial(n-1)/4: n in [1..30]]; // G. C. Greubel, Jul 07 2019
    
  • Maple
    seq((1/4)*factorial(n-1)*(n-1)*(n+2), n = 1 .. 30);
  • Mathematica
    Table[((1/4)(n-1)!(n-1)(n+2)),{n,1,30}] (* Vincenzo Librandi, May 14 2012 *)
  • PARI
    vector(30, n, (n-1)*(n+2)*(n-1)!/4) \\ G. C. Greubel, Jul 07 2019
    
  • Sage
    [(n-1)*(n+2)*factorial(n-1)/4 for n in (1..30)] # G. C. Greubel, Jul 07 2019
    

Formula

a(n) = (1/4)*(n-1)!*(n-1)*(n+2).
a(n) = (n+1)*a(n-1) + (n-2)!.
a(n) = (n-1)*a(n-1) + n!/2.
a(n) = Sum_{k=0..n-1} k*A138771(n,k).
E.g.f. if offset 0: x*(2-x)/(2*(1-x)^3). Such e.g.f. computations resulted from e-mail exchange with Gary Detlefs. - Wolfdieter Lang, May 27 2010
a(n) = A000254(n-1) + A159324(n-1). - Gary Detlefs, May 13 2012
a(n) = n! * Sum_{i=1..n} (Sum_{j=1..i} (j/i)). - Pedro Caceres, Apr 19 2019
E.g.f.: ( x*(2-x)/(1-x)^2 + 2*log(1-x) )/4. - G. C. Greubel, Jul 07 2019
D-finite with recurrence a(n) +(-n-1)*a(n-1) -2*a(n-2) +2*(n-3)*a(n-3)=0. - R. J. Mathar, Jul 26 2022