login
A281944
Triangle read by rows: T(n,k) (n>=1, 3<=k<=n+2) is the number of k-sequences of balls colored with n colors such that exactly two balls are of a color seen previously in the sequence.
2
1, 2, 14, 3, 42, 150, 4, 84, 600, 1560, 5, 140, 1500, 7800, 16800, 6, 210, 3000, 23400, 100800, 191520, 7, 294, 5250, 54600, 352800, 1340640, 2328480, 8, 392, 8400, 109200, 940800, 5362560, 18627840, 30240000, 9, 504, 12600, 196560, 2116800, 16087680, 83825280, 272160000, 419126400, 10, 630, 18000, 327600, 4233600, 40219200, 279417600, 1360800000, 4191264000, 6187104000
OFFSET
1,2
FORMULA
T(n, k) = (binomial(k,3) + 3*binomial(k,4)) * n! / (n+2-k)!.
T(n, k) = n*T(n-1,k-1) + (k-2)*A281881(n,k-1).
EXAMPLE
n=1 => AAA -> T(1,3)=1
n=2 => AAA,BBB -> T(2,3)=2
AAAB,AABA,ABAA,BAAA,BBBA,BBAB,BABB,ABBB,AABB,ABAB,ABBA,BAAB,BABA,BBAA -> T(2,4)=14
Triangle starts:
1
2, 14
3, 42, 150
4, 84, 600, 1560
5, 140, 1500, 7800, 16800
6, 210, 3000, 23400, 100800, 191520
7, 294, 5250, 54600, 352800, 1340640, 2328480
8, 392, 8400, 109200, 940800, 5362560, 18627840, 30240000
9, 504, 12600, 196560, 2116800, 16087680, 83825280, 272160000, 419126400
MATHEMATICA
Table[(Binomial[k, 3] + 3 Binomial[k, 4]) n!/(n + 2 - k)!, {n, 12}, {k, 3, n + 2}] // Flatten (* Michael De Vlieger, Feb 05 2017 *)
PROG
(PARI) T(n, k) = (binomial(k, 3) + 3*binomial(k, 4)) * n! / (n+2-k)!;
tabl(nn) = for (n=1, nn, for (k=3, n+2, print1(T(n, k), ", ")); print()); \\ Michel Marcus, Feb 04 2017
CROSSREFS
Columns of table: T(n,3) = A000027(n), T(n,4) = A163756(n).
Other sequences in table: T(n,n+2) = A037960(n).
Sequence in context: A138907 A336837 A276189 * A306724 A316909 A103979
KEYWORD
nonn,tabl
AUTHOR
Jeremy Dover, Feb 02 2017
STATUS
approved