OFFSET
2,1
LINKS
Andrew Howroyd, Table of n, a(n) for n = 2..1276
FORMULA
T(n,k) = Sum_{j=0..n-2} P(k-1,3) * P(k-2,2) * P(k,2)^(n-2-j) * P(k,4)^j + 2 * (n-j-2) * P(k-1,3)^2 * P(k,2)^(n-3-j) * P(k,4)^j where P(n,k) = binomial(n+k-1,k-1).
T(n,k) = 3*((k^2 + 4*k + 1)*binomial(k+3,3)^(n-1) - (2*k^2 + 9*k + 1)*(k+1)^(n-1) - k*(k + 5)*(n-2)*(k+1)^(n-1))/(k + 5)^2.
EXAMPLE
Array begins:
======================================================
n\k | 2 3 4 5
----|-------------------------------------------------
2 | 3 12 30 60 ...
3 | 57 360 1400 4170 ...
4 | 705 7968 51750 241080 ...
5 | 7617 163584 1830000 13562040 ...
6 | 78357 3293184 64168750 759940800 ...
7 | 791589 65968128 2246625000 42560067360 ...
8 | 7944321 1319854080 78636093750 2383387566720 ...
...
The T(2,2) = 3 permutations of 1122 with 2 local maxima are 1212, 2112, 2121.
PROG
(PARI) T(n, k) = {3*((k^2 + 4*k + 1)*binomial(k+3, 3)^(n-1) - (2*k^2 + 9*k + 1)*(k+1)^(n-1) - k*(k + 5)*(n-2)*(k+1)^(n-1))/(k + 5)^2}
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Andrew Howroyd, May 10 2020
STATUS
approved