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!)
A164163 Number of binary strings of length n with equal numbers of 0001 and 1010 substrings. 1

%I #24 Nov 03 2023 15:37:54

%S 1,2,4,8,14,24,41,72,129,234,431,804,1512,2864,5459,10452,20086,38728,

%T 74871,145068,281646,547764,1066943,2081060,4064097,7945534,15549613,

%U 30459088,59714564,117160356,230034585,451954208,888513601,1747769154

%N Number of binary strings of length n with equal numbers of 0001 and 1010 substrings.

%H Alois P. Heinz, <a href="/A164163/b164163.txt">Table of n, a(n) for n = 0..1000</a> (first 501 terms from R. H. Hardin)

%H Shalosh B. Ekhad and Doron Zeilberger, <a href="http://arxiv.org/abs/1112.6207">Automatic Solution of Richard Stanley's Amer. Math. Monthly Problem #11610 and ANY Problem of That Type</a>, arXiv preprint arXiv:1112.6207 [math.CO], 2011. See subpages for rigorous derivations of g.f., recurrence, asymptotics for this sequence. [From _N. J. A. Sloane_, Apr 07 2012]

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

%p b(n-1, [2, 3, 4$2, 6, 3, 6][t])*`if`(t=7, 1/x, 1)+

%p b(n-1, `if`(t=6, 7, 5))*`if`(t=4, x, 1)))

%p end:

%p a:= n-> coeff(b(n, 1), x, 0):

%p seq(a(n), n=0..40); # _Alois P. Heinz_, Mar 28 2014

%p # second Maple program:

%p a:= proc(n) option remember; `if`(n<6, [1, 2, 4, 8, 14, 24][n+1],

%p ((166*n^3-719*n^2-4319*n+6834) *a(n-1)

%p +(162*n^3-4025*n^2+23078*n-21720) *a(n-2)

%p +(58*n^3+459*n^2-10135*n+32226) *a(n-3)

%p -6*(n-6)*(10*n^2+611*n-4579) *a(n-4)

%p -4*(n-7)*(218*n^2-3243*n+10692) *a(n-5)

%p +8*(n-7)*(n-8)*(82*n-339) *a(n-6))/

%p (n*(110*n^2-1067*n+1938)))

%p end:

%p seq(a(n), n=0..40); # _Alois P. Heinz_, Mar 28 2014

%t a[n_] := a[n] = If[n < 6, {1, 2, 4, 8, 14, 24}[[n + 1]], (1/(n*(110*n^2 - 1067*n + 1938)))*(-(4*(n - 7)*(218*n^2 - 3243*n + 10692)*a[n - 5]) - 6*(n - 6)*(10*n^2 + 611*n - 4579)*a[n - 4] + (58*n^3 + 459*n^2 - 10135*n + 32226)*a[n - 3] + (162*n^3 - 4025*n^2 + 23078*n - 21720)*a[n - 2] + (166*n^3 - 719*n^2 - 4319*n + 6834)*a[n - 1] + 8*(82*n - 339)*(n - 8)*(n - 7)*a[n - 6])];

%t Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, Nov 11 2017, after _Alois P. Heinz_ *)

%K nonn

%O 0,2

%A _R. H. Hardin_, Aug 11 2009

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 May 11 04:25 EDT 2024. Contains 372388 sequences. (Running on oeis4.)