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 A187249 #15 Jul 26 2022 13:21:30 %S A187249 0,1,3,11,48,248,1504,10560,84544,761024,7610496,83715968,1004592640, %T A187249 13059706368,182835893248,2742538406912,43880614526976, %U A187249 745970446991360,13427468045910016,255121892872421376,5102437857448689664,107151195006423007232,2357326290141307207680 %N A187249 Number of cycles with at most 2 alternating runs in all permutations of [n] (it is assumed that the smallest element of the cycle is in the first position). %C A187249 a(n) = Sum_{k>=0} k * A187247(n,k). %H A187249 Alois P. Heinz, <a href="/A187249/b187249.txt">Table of n, a(n) for n = 0..450</a> %F A187249 E.g.f.: g(z) = (1/4)[exp(2z) - 1 +2z]/(1-z). %F A187249 a(n) ~ (exp(2)+1)/4 * n! = 2.09726402473266... * n!. - _Vaclav Kotesovec_, Mar 15 2014 %F A187249 D-finite with recurrence a(n) +(-n-2)*a(n-1) +2*(n-1)*a(n-2)=0. - _R. J. Mathar_, Jul 26 2022 %e A187249 a(3)=11 because in (1)(2)(3), (1)(23), (12)(3), (13)(2), (123), and (132) all cycles have at most 2 alternating runs. %p A187249 g := (1/4*(exp(2*z)-1+2*z))/(1-z): gser := series(g, z = 0, 25): seq(factorial(n)*coeff(gser, z, n), n = 0 .. 22); %p A187249 # second Maple program: %p A187249 b:= proc(n) option remember; expand( %p A187249 `if`(n=0, 1, add(b(n-j)*binomial(n-1, j-1)* %p A187249 `if`(j=1, x, (j-1)!+2^(j-2)*(x-1)), j=1..n))) %p A187249 end: %p A187249 a:= n-> (p-> add(coeff(p, x, i)*i, i=0..n))(b(n)): %p A187249 seq(a(n), n=0..30); # _Alois P. Heinz_, Apr 15 2017 %t A187249 CoefficientList[Series[(E^(2*x)-1+2*x)/(4*(1-x)), {x, 0, 20}], x]* Range[0, 20]! (* _Vaclav Kotesovec_, Mar 15 2014 *) %Y A187249 Cf. A187247. %K A187249 nonn %O A187249 0,3 %A A187249 _Emeric Deutsch_, Mar 07 2011