%I #33 Sep 08 2022 08:45:48
%S 0,0,2,6,16,38,86,188,402,846,1760,3630,7438,15164,30794,62342,125904,
%T 253782,510758,1026684,2061730,4136990,8295872,16627166,33311646,
%U 66716028,133582106,267406998,535206832,1071049286,2143127030,4287918140,8578528818
%N a(n) is the number of n-tosses having a run of 3 or more heads or a run of 3 or more tails for a fair coin (i.e., probability is a(n)/2^n).
%C A167821(n) is the difference between A000918(n), the number of branches of a complete binary tree of n levels, and the number of recursive calls needed to compute the (n+1)-th Fibonacci number F(n+1) as defined in A019274: A167821(n) = A000918(n) - A019274(n+1). - _Denis Lorrain_, Jan 14 2012
%C Partial sums of A027934 multiplied term by term by 2 (as shown by the second formula), i.e., partial sums of row sums of A108617. - _J. M. Bergot_, Oct 02 2012, clarified by _R. J. Mathar_, Oct 05 2012
%H G. C. Greubel, <a href="/A167821/b167821.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3, -1, -2).
%F G.f.: (2 x^2)/(1 - 3 x + x^2 + 2 x^3);
%F a(n) = 2^n - 2*Fibonacci(n+1).
%F a(n) = 3*a(n-1) - a(n-2) - 2*a(n-3). - _G. C. Greubel_, Jun 27 2016
%t CoefficientList[Series[(2 x^2)/(1 - 3 x + x^2 + 2 x^3), {x, 0, 30}], x]
%t Table[2^n - 2*Fibonacci[n + 1], {n, 1, 31}]
%t LinearRecurrence[{3, -1, -2}, {0, 0, 2}, 50] (* _G. C. Greubel_, Jun 27 2016 *)
%o (Magma) [2^n-2*Fibonacci(n+1): n in [1..40]]; // _Vincenzo Librandi_, Jun 28 2016
%Y Cf. A008466, A050231.
%K easy,nonn
%O 1,3
%A _V.J. Pohjola_, Nov 13 2009
|