login
A180883
Number of permutations p() of 1..n+6 with centered difference p(i+1)-p(i-1) < 0 exactly 5 times
1
35, 1540, 45738, 877968, 13547688, 174550992, 1997701992, 20732684544, 200430861345, 1825340594220, 15885688179790, 132967715234640, 1079711852655436, 8537605886212832, 66114368122853232, 502516350655667712
OFFSET
1,1
COMMENTS
Column 6 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, 6), "\n";
}
quit
CROSSREFS
Sequence in context: A195617 A249885 A135923 * A130005 A199362 A373115
KEYWORD
nonn
AUTHOR
R. H. Hardin Sep 23 2010
STATUS
approved