Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #3 Mar 31 2012 12:35:48
%S 6,50,360,1960,10010,45738,203616,854700,3560172,14299428,57595824,
%T 226022940,895687650,3473777450,13672916400,52745436172,207268333844,
%U 798176908620,3139574496240,12092845015888,47667323303236
%N Number of permutations p() of 1..n+3 with centered difference p(i+1)-p(i-1) < 0 exactly twice
%C Column 3 of A180887
%H R. H. Hardin, <a href="/A180880/b180880.txt">Table of n, a(n) for n=1..100</a>
%o /* bc , formula r(n,k) from A000892 */
%o define factorial(n) {
%o auto prod;
%o prod=1;
%o while(n>=2)prod*=n--;
%o return prod;
%o }
%o define binomial(n,i) {
%o if(i<0||i>n)return 0;
%o return factorial(n)/(factorial(i)*factorial(n-i));
%o }
%o define r(n,k) {
%o auto j,sum;
%o sum=0;
%o for(j=0; j<=k+1; j++) {
%o sum+=(-1)^j*(k+1-j)^n*binomial(n+1,j);
%o }
%o return sum;
%o }
%o define t(n,k) {
%o auto sum,i;
%o sum=0;
%o for(i=0; i<=(k-1); i++)sum+=r((n+k)/2,i)*r((n+k)-(n+k)/2,(k-1)-i);
%o return sum*binomial((n+k),(n+k)/2);
%o }
%o for(n=1; n<=100; n++) {
%o print n, " ", t(n,3), "\n";
%o }
%o quit
%K nonn
%O 1,1
%A _R. H. Hardin_ Sep 23 2010