login
A180881
Number of permutations p() of 1..n+4 with centered difference p(i+1)-p(i-1) < 0 exactly 3 times
1
10, 160, 1960, 17080, 130914, 877968, 5517204, 32369568, 183346020, 997586304, 5324138820, 27695982600, 142629565650, 721661798000, 3635721869780, 18075459889344, 89830487207916, 441561520370880, 2175990796288400
OFFSET
1,1
COMMENTS
Column 4 of A180887
LINKS
PROG
/* bc , formula r(n, k) from A000892 */
define factorial(n) {
auto prod;
prod=1;
while(n>=2)prod*=n--;
return prod;
}
define binomial(n, i) {
if(i<0||i>n)return 0;
return factorial(n)/(factorial(i)*factorial(n-i));
}
define r(n, k) {
auto j, sum;
sum=0;
for(j=0; j<=k+1; j++) {
sum+=(-1)^j*(k+1-j)^n*binomial(n+1, j);
}
return sum;
}
define t(n, k) {
auto sum, i;
sum=0;
for(i=0; i<=(k-1); i++)sum+=r((n+k)/2, i)*r((n+k)-(n+k)/2, (k-1)-i);
return sum*binomial((n+k), (n+k)/2);
}
for(n=1; n<=100; n++) {
print n, " ", t(n, 4), "\n";
}
quit
CROSSREFS
Sequence in context: A360935 A116041 A284110 * A106261 A112125 A366037
KEYWORD
nonn
AUTHOR
R. H. Hardin Sep 23 2010
STATUS
approved