OFFSET
2,1
COMMENTS
T(n,k) is divisible by n and 2*T(n,k) is divisible by n*k.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 2..1276
FORMULA
T(n,k) = n*k*( P(k,4)^(n-2) * P(k-2,2)^2 + 4*(Sum_{j=0..n-3} P(k-1,3) * P(k-2,2) * P(k,2)^j * P(k, 4)^(n-j-3)) + 4*(Sum_{j=0..n-4} (j + 1) * P(k-1,3)^2 * P(k,2)^j * P(k,4)^(n-j-4)) )/2 where P(n,k) = binomial(n+k-1, k-1).
T(n,k) = n*k*( (k^2 + 4*k + 1)^2*binomial(k+3, 3)^(n-2) + 12*(k + 2)*(k+1)^(n-2) - 6*k*(k+5)*n*(k+1)^(n-2))/(2*(k + 5)^2).
EXAMPLE
Array begins:
==========================================================
n\k | 2 3 4 5
----|----------------------------------------------------
2 | 2 12 36 80 ...
3 | 66 576 2610 8520 ...
4 | 1168 17376 129800 659560 ...
5 | 16220 448800 5748750 46412200 ...
6 | 202416 10861056 241987500 3121135440 ...
7 | 2395540 253940736 9885006250 203933233280 ...
8 | 27517568 5807161344 395426250000 13051880894720 ...
...
The T(2,3) = 12 permutations of 111222 with 2 local maxima are 112122, 112212 and their rotations.
The T(3,2) = 66 permutations of 112233 with 2 local maxima are 112323, 113223, 113232, 121233, 121332, 122133, 122313, 123213, 123123, 123132, 131322 and their rotations.
PROG
(PARI) T(n, k)={n*k*( (k^2 + 4*k + 1)^2*binomial(k+3, 3)^(n-2) + 12*(k + 2)*(k+1)^(n-2) - 6*k*(k+5)*n*(k+1)^(n-2))/(2*(k + 5)^2)}
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Andrew Howroyd, May 10 2020
STATUS
approved