login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A334833 Total length squared of longest runs of 1's in all bitstrings of length n. 1
1, 6, 21, 61, 158, 386, 902, 2051, 4565, 10006, 21668, 46484, 98958, 209360, 440627, 923299, 1927456, 4010730, 8322242, 17226050, 35578192, 73339778, 150918130, 310073773, 636173403, 1303554560, 2667935114, 5454522188, 11140674850, 22733861902, 46352349432, 94435176992 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

a(n) divided by 2^n is the expected value of the longest run, squared, of heads in n tosses of a fair coin.

LINKS

Table of n, a(n) for n=1..32.

Steven Finch, Variance of longest run duration in a random bitstring, arXiv:2005.12185 [math.CO], 2020.

FORMULA

O.g.f.: Sum_{k>=1} (2*k-1)*(1/(1-2*x) - (1-x^k)/(1-2*x+x^(k+1))).

EXAMPLE

a(3)=21 because for the 8(2^3) possible runs 0 is longest run of heads once, 1 four times, 2 two times and 3 once and 0*1+1*4+4*2+9*1 = 21.

MATHEMATICA

nn = 10; Drop[Apply[Plus, Table[CoefficientList[Series[(2 n - 1) (1/(1 - 2 x) - (1 - x^n)/(1 - 2 x + x^(n + 1))), {x, 0, nn}], x], {n, 1, nn}]], 1]

CROSSREFS

Cf. A119706.

Sequence in context: A009147 A012593 A276235 * A048476 A122678 A256569

Adjacent sequences:  A334830 A334831 A334832 * A334834 A334835 A334836

KEYWORD

nonn

AUTHOR

Steven Finch, May 15 2020

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 22 06:08 EDT 2020. Contains 337289 sequences. (Running on oeis4.)