

A050231


a(n) is the number of ntosses having a run of 3 or more heads for a fair coin (i.e., probability is a(n)/2^n).


15



0, 0, 1, 3, 8, 20, 47, 107, 238, 520, 1121, 2391, 5056, 10616, 22159, 46023, 95182, 196132, 402873, 825259, 1686408, 3438828, 6999071, 14221459, 28853662, 58462800, 118315137, 239186031, 483072832, 974791728, 1965486047
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,4


COMMENTS

a(n1) is the number of compositions of n with at least one part >= 4.  Joerg Arndt, Aug 06 2012


REFERENCES

W. Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, 2nd ed. New York: Wiley, p. 300, 1968.


LINKS

Eric Weisstein's World of Mathematics, Run


FORMULA

a(n) = 2 * a(n1) + 2^(n4)  a(n4) since we can add T or H to a sequence of n1 flips which has HHH, and H to one which ends in THH and does not have HHH among the first (n4) flips.  Toby Gottfried, Nov 20 2010
a(n) = 3*a(n1)  a(n2)  a(n3)  2*a(n4), a(0)=0, a(1)=0, a(2)=1, a(3)=3.  David Nacin, Mar 07 2012


MATHEMATICA

LinearRecurrence[{3, 1, 1, 2}, {0, 0, 1, 3}, 50] (* David Nacin, Mar 07 2012 *)


PROG

(Python)
def a(n, adict={0:0, 1:0, 2:1, 3:3}):
if n in adict:
return adict[n]
adict[n]=3*a(n1)a(n2)a(n3)2*a(n4)


CROSSREFS



KEYWORD

nonn,nice,easy


AUTHOR



STATUS

approved



