Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A143662
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A143662 a(n) is the number of n-tosses having a run of 6 or more heads for a fair coin (i.e. probability is a(n)/2^n). +0
1
0, 0, 0, 0, 0, 0, 1, 3, 8, 20, 48, 112, 256, 575, 1275, 2798, 6088, 13152, 28240, 60320, 128257, 271623, 573216, 1205880, 2529680, 5293264, 11050496, 23021311, 47868151 (list; graph; listen)
OFFSET

1,8

PROGRAM

/*C++*/ #include <iostream> using namespace std; typedef unsigned long long __Int; const size_t MAX_M = sizeof(__Int) * 8; __Int countProp(__Int N, __Int M) { if(M > __Int(MAX_M)) return 0; else if(N > M) return 0; const __Int MASK = (__Int(1) << N) - 1; const __Int END = (__Int(1) << M) - 1; __Int ret = 0; for(__Int i = 0; i < END; ++i){ for(__Int j = 0; j <= (M - N); ++j){ const __Int m = MASK << j; if((i & m) == m){ ++ret; break; } } } return ++ret; } int main() { const __Int N = 6; for(__Int m = 0; m <= __Int(MAX_M); ++m) cout<<countProp(N, m)<<endl; }

CROSSREFS

Sequence in context: A026712 A050232 A050233 this_sequence A049610 A001792 A018795

Adjacent sequences: A143659 A143660 A143661 this_sequence A143663 A143664 A143665

KEYWORD

nonn

AUTHOR

DoZerg (daidodo(AT)gmail.com), Aug 28 2008

page 1

Search completed in 0.013 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 7 23:50 EST 2009. Contains 170430 sequences.


AT&T Labs Research