|
| |
|
|
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
| |
|
|
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; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,8
|
|
|
PROG
| /*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 * A001792 A049610 A168150
Adjacent sequences: A143659 A143660 A143661 * A143663 A143664 A143665
|
|
|
KEYWORD
| nonn
|
|
|
AUTHOR
| DoZerg (daidodo(AT)gmail.com), Aug 28 2008
|
| |
|
|