login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A227924
Triangle T(n,k): the number of binary sequences of n zeros and n ones in which the shortest run is of length k.
1
2, 4, 2, 18, 0, 2, 64, 4, 0, 2, 238, 12, 0, 0, 2, 890, 28, 4, 0, 0, 2, 3348, 70, 12, 0, 0, 0, 2, 12662, 182, 20, 4, 0, 0, 0, 2, 48102, 466, 38, 12, 0, 0, 0, 0, 2, 183460, 1186, 84, 20, 4, 0, 0, 0, 0, 2
OFFSET
1,1
COMMENTS
Row n sums to C(2n,n) (A000984).
EXAMPLE
The triangle begins:
[2,
[4, 2,
[18, 0, 2,
[64, 4, 0, 2,
[238, 12, 0, 0, 2,
The second row counts the sets {0101, 1010, 0110, 1001} and {0011, 1100}.
PROG
(PARI)
bn(n, k)=binomial(max(0, n), k)
f(n, k)=2*sum(x=1, floor(n/k), bn(n+x*(1-k)-1, x-1)*(bn(n+x*(1-k)-1, x-1)+bn(n+(x+1)*(1-k)-1, x)))
T(n, k)=f(n, k)-f(n, k+1)
r(n)=vector(n, x, T(n, x))
CROSSREFS
Cf. A229756.
Sequence in context: A186526 A350816 A326723 * A100944 A295390 A059890
KEYWORD
nonn,tabl
AUTHOR
Andrew Woods, Oct 09 2013
STATUS
approved