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.
%I A162971 #25 Oct 07 2024 01:25:27 %S A162971 1,0,1,0,3,1,0,8,6,1,0,30,35,10,1,0,144,210,85,15,1,0,840,1414,735, %T A162971 175,21,1,0,5760,10752,6664,1960,322,28,1,0,45360,91692,64764,22449, %U A162971 4536,546,36,1,0,403200,869040,679580,268380,63273,9450,870,45,1,0,3991680,9074736,7704180,3382280,902055,157773,18150,1320,55,1 %N A162971 Triangle read by rows: T(n,k) is number of non-derangement permutations of {1,2,...,n} having k cycles (1 <= k <= n). %C A162971 Sum of entries in row n = A002467(n) (the number of non-derangement permutations of {1,2,...,n}). %C A162971 T(n,2) = n*(n-2)! = A001048(n-1) for n>=3. %C A162971 Sum_{k=1..n} k*T(n,k) = A162972(n). %H A162971 Alois P. Heinz, <a href="/A162971/b162971.txt">Rows n = 1..150, flattened</a> %F A162971 E.g.f.: G(t,z) = (1-exp(-tz))/(1-z)^t. %e A162971 T(4,2) = 8 because we have (1)(234), (1)(243), (134)(2), (143)(2), (124)(3), (142)(3), (123)(4), and (132)(4). %e A162971 Triangle starts: %e A162971 1; %e A162971 0, 1; %e A162971 0, 3, 1; %e A162971 0, 8, 6, 1; %e A162971 0, 30, 35, 10, 1; %e A162971 0, 144, 210, 85, 15, 1; %e A162971 ... %p A162971 G := (1-exp(-t*z))/(1-z)^t: Gser := simplify(series(G, z = 0, 15)): for n to 11 do P[n] := sort(expand(factorial(n)*coeff(Gser, z, n))) end do: for n to 11 do seq(coeff(P[n], t, j), j = 1 .. n) end do; # yields sequence in triangular form %p A162971 # second Maple program: %p A162971 b:= proc(n, t) option remember; `if`(n=0, t, add(expand((j-1)!* %p A162971 b(n-j, `if`(j=1, 1, t))*x)*binomial(n-1, j-1), j=1..n)) %p A162971 end: %p A162971 T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n, 0)): %p A162971 seq(T(n), n=1..12); # _Alois P. Heinz_, Aug 15 2023 %t A162971 b[n_, t_] := b[n, t] = If[n == 0, t, Sum[Expand[(j - 1)!*b[n - j, If[j == 1, 1, t]]*x]*Binomial[n - 1, j - 1], {j, 1, n}]]; %t A162971 T[n_] := CoefficientList[b[n, 0]/x, x]; %t A162971 Table[T[n], {n, 1, 12}] // Flatten (* _Jean-François Alcover_, Apr 04 2024, after _Alois P. Heinz_ *) %Y A162971 Cf. A001048, A002467, A162972. %K A162971 nonn,tabl %O A162971 1,5 %A A162971 _Emeric Deutsch_, Jul 22 2009