cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A238644 Number of binary words on {H,T} that end in THTH but do not contain the contiguous subsequence HTHH.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 6, 11, 19, 34, 62, 112, 202, 365, 659, 1189, 2146, 3874, 6993, 12623, 22786, 41131, 74245, 134019, 241917, 436683, 788254, 1422873, 2568420, 4636240, 8368850, 15106563, 27268770, 49222700, 88851613, 160385536, 289511009, 522594658, 943332613, 1702804277
Offset: 0

Views

Author

Geoffrey Critzer, Mar 01 2014

Keywords

Comments

In the Penney game THTH beats HTHH 9 times out of 14 yet the expected wait time for THTH is 20 while that for HTHH is only 18.

Examples

			a(7)=6 because we have: TTTTHTH, THTTHTH, THHTHTH, HTTTHTH, HHTTHTH, HHHTHTH.
		

Crossrefs

Cf. A171861.

Programs

  • Mathematica
    nn=40;CoefficientList[Series[(x^4+x^7)/(1-2x+x^2-x^3-x^6),{x,0,nn}],x]
    LinearRecurrence[{2,-1,1,0,0,1},{0,0,0,0,1,2,3,6},50]

Formula

G.f.: G(x) = (x^4 + x^7)/(1 - 2x + x^2 - x^3 - x^6). We note G(1/2) = 9/14.