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 A152663 #14 Apr 02 2024 12:04:59 %S A152663 1,1,6,16,120,540,5040,32256,362880,3024000,39916800,410572800, %T A152663 6227020800,76281004800,1307674368000,18598035456000,355687428096000, %U A152663 5762136335155200,121645100408832000,2211729098342400000,51090942171709440000,1030334000462807040000 %N A152663 Number of leading odd entries in all permutations of {1,2,...,n} (see example). %C A152663 a(n) = Sum_{k=0..ceiling(n/2)} k*A152662(n,k). %F A152663 a(2n+1) = (2n+1)!; %F A152663 a(2n) = n(2n)!/(n+1). %F A152663 D-finite with recurrence 2*(n+2)*a(n) +3*(-n-1)*a(n-1) -2*n*(n-1)*(n+1)*a(n-2) +(n-2)*(n-1)^2*a(n-3)=0. - _R. J. Mathar_, Jul 26 2022 %e A152663 a(3) = 6 because in the permutations 123, 132, 213, 231, 312, 321 we have 1+2+0+0+2+1 = 6 leading odd entries. %p A152663 ao := proc (n) options operator, arrow; factorial(2*n+1) end proc: ae := proc (n) options operator, arrow: n*factorial(2*n)/(n+1) end proc: a := proc (n) if `mod`(n, 2) = 1 then ao((1/2)*n-1/2) else ae((1/2)*n) end if end proc: seq(a(n), n = 1 .. 20); %t A152663 a[n_] := If[OddQ[n], n!, n*n!/(n+2)]; %t A152663 Table[a[n], {n, 1, 20}] (* _Jean-François Alcover_, Apr 02 2024 *) %Y A152663 Cf. A152662, A152664, A152665. %K A152663 nonn %O A152663 1,3 %A A152663 _Emeric Deutsch_, Dec 13 2008