login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A242593 Triangular array read by rows: T(n,k) is the number of length n words on {B,G} that contain exactly k occurrences of the contiguous substrings BGB or GBG. The substrings are allowed to overlap; n>=0, 0<=k<=max(n-2,0). 2

%I #19 Apr 28 2018 17:23:46

%S 1,2,4,6,2,10,4,2,16,10,4,2,26,20,12,4,2,42,40,26,14,4,2,68,76,58,32,

%T 16,4,2,110,142,120,78,38,18,4,2,178,260,244,172,100,44,20,4,2,288,

%U 470,482,374,232,124,50,22,4,2,466,840,936,784,534,300,150,56,24,4,2,754,1488,1788,1612,1176,726,376,178,62,26,4,2

%N Triangular array read by rows: T(n,k) is the number of length n words on {B,G} that contain exactly k occurrences of the contiguous substrings BGB or GBG. The substrings are allowed to overlap; n>=0, 0<=k<=max(n-2,0).

%C Equivalently, T(n,k) is the number of ways to arrange n children in a line so that exactly k children are in between two children of opposite gender than their own. Children on the ends of the line cannot be counted as "in between".

%C Row sums = 2^n.

%C Column k=0 is A128588.

%H Alois P. Heinz, <a href="/A242593/b242593.txt">Rows n = 0..150, flattened</a>

%F G.f.: 1/(1 - 2*x - 2*(y-1)*x^3/(1 - (y-1)*x - (y-1)*x^2) ).

%e Triangle T(n,k) begins:

%e 1;

%e 2;

%e 4;

%e 6, 2;

%e 10, 4, 2;

%e 16, 10, 4, 2;

%e 26, 20, 12, 4, 2;

%e 42, 40, 26, 14, 4, 2;

%e 68, 76, 58, 32, 16, 4, 2;

%e 110, 142, 120, 78, 38, 18, 4, 2,

%e 178, 260, 244, 172, 100, 44, 20, 4, 2;

%e T(4,1) = 4 because we have: BBGB, BGBB, GBGG, GGBG.

%e T(4,2) = 2 because we have: BGBG, GBGB.

%p b:= proc(n, t) option remember; `if`(n=0, 1, expand(

%p b(n-1, [4, 3, 4, 4, 3][t])*`if`(t=5, x, 1)+

%p b(n-1, [2, 2, 5, 5, 2][t])*`if`(t=3, x, 1)))

%p end:

%p T:= n-> (p-> seq(coeff(p,x,i), i=0..degree(p)))(b(n, 1)):

%p seq(T(n), n=0..16); # _Alois P. Heinz_, May 18 2014

%t nn=10;sol=Solve[{A==va(z^3+z^2A+z B),B==va(z^3+z^2 B + z A)},{A,B}]; Fz[z_,y_]:=Simplify[1/(1-2z-A-B)/.sol/.va->y-1]; Map[Select[#,#>0&]&, Level[CoefficientList[Series[Fz[z,y],{z,0,nn}],{z,y}],{2}]]//Grid

%Y Cf. A128588.

%K nonn,tabf

%O 0,2

%A _Geoffrey Critzer_, May 18 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 22:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)