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 A059204 #26 Apr 07 2025 11:53:47 %S A059204 0,0,0,2,16,104,688,4976,40192,362624,3628288,39915776,478999552, %T A059204 6227016704,87178283008,1307674351616,20922789855232,355687428030464, %U A059204 6402373705596928,121645100408569856,2432902008176115712,51090942171708391424,1124000727777605582848 %N A059204 Number of non-unimodal permutations of n items (i.e., those which do not simply go up for the first part and then down for the rest, but at some point go down then up). %C A059204 Number of permutations of [n] minus the number of compositions of n. - _Zerinvary Lajos_, Oct 16 2006 %H A059204 Alois P. Heinz, <a href="/A059204/b059204.txt">Table of n, a(n) for n = 0..250</a> %F A059204 a(n) = n! - ceiling(2^(n-1)) = A000142(n) - A011782(n). %F A059204 E.g.f.: (1+x)/(2*(1-x))-exp(2*x)/2. %e A059204 a(3) = 2 since the possibilities are {BAC, CAB}. a(4) = 16 since the possibilities are {ACBD, ADBC, BACD, BADC, BCAD, BDAC, CABD, CADB, CBAD, CBDA, CDAB, DABC, DACB, DBAC, DBCA, DCAB}. %p A059204 a:= n-> n!-ceil(2^(n-1)): %p A059204 seq(a(n), n=0..30); %t A059204 nn=30;Range[0,nn]!CoefficientList[Series[1/(1-x)-Exp[2x]/2-1/2,{x,0,nn}],x] (* _Geoffrey Critzer_, Mar 17 2014 *) %o A059204 (PARI) x= 'x + O('x^50); concat([0,0,0], Vec(serlaplace((1+x)/(2*(1-x))-exp(2*x)/2))) \\ _G. C. Greubel_, Dec 28 2016 %K A059204 easy,nonn %O A059204 0,4 %A A059204 _Henry Bottomley_, Jan 17 2001