login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A180882
Number of permutations p() of 1..n+5 with centered difference p(i+1)-p(i-1) < 0 exactly 4 times
1
20, 525, 10010, 130914, 1438920, 13547688, 116189304, 917857512, 6866412696, 48911180175, 336896355510, 2249124467590, 14697484687600, 94059343340820, 593714385206800, 3693679623479664, 22778493196278456, 139016435228687562
OFFSET
1,1
COMMENTS
Column 5 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, 5), "\n";
}
quit
CROSSREFS
Sequence in context: A250016 A371017 A337352 * A202920 A210486 A047682
KEYWORD
nonn
AUTHOR
R. H. Hardin Sep 23 2010
STATUS
approved