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 A152668 #13 Apr 09 2024 10:52:21 %S A152668 2,6,36,192,1440,10800,100800,967680,10886400,127008000,1676505600, %T A152668 22992076800,348713164800,5492232345600,94152554496000, %U A152668 1673823191040000,32011868528640000,633834996867072000,13380961044971520000 %N A152668 Number of runs of even entries in all permutations of {1,2,...,n} (the permutation 274831659 has 3 runs of even entries: 2, 48 and 6). %C A152668 a(n) = Sum(k*A152667(n,k), k=1..floor(n/2)). %F A152668 a(2n) = (n+1)(2n)!/2; %F A152668 a(2n+1) = n(n+2)(2n)!. %F A152668 D-finite with recurrence a(n) -2*a(n-1) -n*(n-1)*a(n-2) +2*(n-3)*(n-4)*a(n-4)=0. - _R. J. Mathar_, Jul 24 2022 %e A152668 a(3) = 6 because each of the permutations 123, 132, 213, 231, 312, 321 has exactly 1 run of even entries. %p A152668 ae := proc (n) options operator, arrow: (1/2)*factorial(2*n)*(n+1) end proc: ao := proc (n) options operator, arrow: n*(n+2)*factorial(2*n) end proc: a := proc (n) if `mod`(n, 2) = 0 then ae((1/2)*n) else ao((1/2)*n-1/2) end if end proc; seq(a(n), n = 2 .. 20); %t A152668 a[n_] := If[EvenQ[n], (n/2+1)n!/2, ((n-1)/2)((n-1)/2+2)(n-1)!]; %t A152668 Table[a[n], {n, 2, 20}] (* _Jean-François Alcover_, Apr 09 2024 *) %Y A152668 Cf. A152667, A052618. %K A152668 nonn %O A152668 2,1 %A A152668 _Emeric Deutsch_, Dec 14 2008