Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #21 Feb 06 2017 03:39:03
%S 1,2,14,3,42,150,4,84,600,1560,5,140,1500,7800,16800,6,210,3000,23400,
%T 100800,191520,7,294,5250,54600,352800,1340640,2328480,8,392,8400,
%U 109200,940800,5362560,18627840,30240000,9,504,12600,196560,2116800,16087680,83825280,272160000,419126400,10,630,18000,327600,4233600,40219200,279417600,1360800000,4191264000,6187104000
%N 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.
%H Jeremy Dover, <a href="/A281944/b281944.txt">Table of n, a(n) for n = 1..1035</a>
%H Jeremy Dover, <a href="http://math.stackexchange.com/a/2109013/342250">Answer to Cumulative Distribution Function of Collision Counts</a>
%F T(n, k) = (binomial(k,3) + 3*binomial(k,4)) * n! / (n+2-k)!.
%F T(n, k) = n*T(n-1,k-1) + (k-2)*A281881(n,k-1).
%e n=1 => AAA -> T(1,3)=1
%e n=2 => AAA,BBB -> T(2,3)=2
%e AAAB,AABA,ABAA,BAAA,BBBA,BBAB,BABB,ABBB,AABB,ABAB,ABBA,BAAB,BABA,BBAA -> T(2,4)=14
%e Triangle starts:
%e 1
%e 2, 14
%e 3, 42, 150
%e 4, 84, 600, 1560
%e 5, 140, 1500, 7800, 16800
%e 6, 210, 3000, 23400, 100800, 191520
%e 7, 294, 5250, 54600, 352800, 1340640, 2328480
%e 8, 392, 8400, 109200, 940800, 5362560, 18627840, 30240000
%e 9, 504, 12600, 196560, 2116800, 16087680, 83825280, 272160000, 419126400
%t 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 *)
%o (PARI) T(n, k) = (binomial(k,3) + 3*binomial(k,4)) * n! / (n+2-k)!;
%o tabl(nn) = for (n=1, nn, for (k=3, n+2, print1(T(n,k), ", ")); print()); \\ _Michel Marcus_, Feb 04 2017
%Y Columns of table: T(n,3) = A000027(n), T(n,4) = A163756(n).
%Y Other sequences in table: T(n,n+2) = A037960(n).
%K nonn,tabl
%O 1,2
%A _Jeremy Dover_, Feb 02 2017