A274742 Triangle read by rows: T(n,k) (n>=3, 0<=k<=n-3) = number of n-sequences of 0's and 1's that begin with 1 and have exactly one pair of adjacent 0's and exactly k pairs of adjacent 1's.
1, 1, 1, 2, 2, 1, 2, 4, 3, 1, 3, 6, 6, 4, 1, 3, 9, 12, 8, 5, 1, 4, 12, 18, 20, 10, 6, 1, 4, 16, 30, 30, 30, 12, 7, 1, 5, 20, 40, 60, 45, 42, 14, 8, 1, 5, 25, 60, 80, 105, 63, 56, 16, 9, 1, 6, 30, 75, 140, 140, 168, 84, 72, 18, 10, 1, 6, 36, 105, 175, 280, 224, 252, 108, 90, 20, 11, 1, 7, 42, 126, 280, 350, 504, 336, 360, 135, 110, 22, 12, 1
Offset: 3
Examples
n=3 => 100 -> T(3,0) = 1. n=4 => 1001 -> T(4,0) = 1; 1100 -> T(4,1) = 1. n=5 => 10010, 10100 -> T(5,0) = 1; 10011, 11001 -> T(5,1) = 2; 11100 -> T(5,2) = 1. Triangle starts: 1 1, 1 2, 2, 1 2, 4, 3, 1 3, 6, 6, 4, 1 3, 9, 12, 8, 5, 1 4, 12, 18, 20, 10, 6, 1 4, 16, 30, 30, 30, 12, 7, 1 5, 20, 40, 60, 45, 42, 14, 8, 1 5, 25, 60, 80, 105, 63, 56, 16, 9, 1 6, 30, 75, 140, 140, 168, 84, 72, 18, 10, 1 6, 36, 105, 175, 280, 224, 252, 108, 90, 20, 11, 1 7, 42, 126, 280, 350, 504, 336, 360, 135, 110, 22, 12, 1
Programs
-
Mathematica
Table[Binomial[Floor[(n + k - 2)/2], k] Floor[(n - k - 1)/2], {n, 3, 15}, {k, 0, n - 3}] // Flatten (* Michael De Vlieger, Jul 05 2016 *)
-
PARI
t(n, k) = binomial(floor((n+k-2)/2), k) * floor((n-k-1)/2) trianglerows(n) = for(x=3, n+2, for(y=0, x-3, print1(t(x, y), ", ")); print("")) trianglerows(13) \\ Felix Fröhlich, Jul 05 2016
Formula
T(n,k) = binomial(floor((n+k-2)/2),k)*floor((n-k-1)/2).
Comments