This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A118645 #43 May 03 2017 08:42:24 %S A118645 0,0,1,4,10,23,51,109,228,471,964,1960,3967,8003,16107,32362,64941, %T A118645 130200,260866,522415,1045831,2093129,4188408,8379967,16764552, %U A118645 33535872,67081663,134177863,268377031,536785286,1073616333,2147299732 %N A118645 Number of binary strings of length n such that there exist three consecutive digits where at least two of them are 1's. %C A118645 We set a(2) = 1 by convention; there is one string of length 2 which has two consecutive 1's, namely 11. This also makes various formulas simpler. %C A118645 For n>=3, a(n) = 2^n - the sum of all terms in the (n-3)rd power of the 4 X 4 matrix [[1 1 0 0] [0 0 1 0] [0 0 0 1] [1 1 0 0]] because this matrix represents the transitions from the state where the last three bits are 000, 001, 010, 100 to the state after the next bit, always avoiding two 1's out of the last three bits. - _Joshua Zucker_, Aug 04 2006 %C A118645 Complementary to A048625 which starts 4,6,9,13,19,28,41,60,88,129,189. For n >= 3, a(n) + A048625(n-3) = 2^n. A048625 is a subsequence of A000930, A068921 and A078012. All of them satisfy the recurrence a(n) = a(n-1) + a(n-3). - _Tanya Khovanova_, Aug 22 2006 %H A118645 G. C. Greubel, <a href="/A118645/b118645.txt">Table of n, a(n) for n = 0..1000</a> %H A118645 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,1,-2). %F A118645 a(n) = 3*2^(n-3) + a(n-1) + a(n-3) for n >= 3. - _Tanya Khovanova_, Aug 22 2006 %F A118645 From _R. J. Mathar_, Oct 03 2011: (Start) %F A118645 G.f.: (x^3 + x^2)/(2*x^4 - x^3 + 2*x^2 - 3*x + 1). %F A118645 G.f.: x^2 * (x+1)/((2*x-1)*(x^3+x-1)). %F A118645 a(n) = 2^n - A000930(n+2). (End) %e A118645 a(4) = 10 because we have: 0011, 0101, 0110, 0111, 1010, 1011, 1100, 1101, 1110, 1111. - _Geoffrey Critzer_, Jan 19 2014 %t A118645 nn=31;r=Solve[{s==1+x s+x b,a==x s,b==x a,c==x a+x b+2x c},{s,a,b,c}]; CoefficientList[Series[c/.r,{x,0,nn}],x] (* _Geoffrey Critzer_, Jan 19 2014 *) %t A118645 LinearRecurrence[{3,-2,1,-2},{0,0,1,4},40] (* _Harvey P. Dale_, Dec 15 2014 *) %o A118645 (PARI) x='x+O('x^50); concat([0,0], Vec((x^3 + x^2)/(2*x^4 - x^3 + 2*x^2 - 3*x + 1))) \\ _G. C. Greubel_, May 02 2017 %K A118645 nonn,easy %O A118645 0,4 %A A118645 _Tanya Khovanova_, May 10 2006 %E A118645 More terms from _Joshua Zucker_, Aug 04 2006 %E A118645 Edited by _Franklin T. Adams-Watters_, Sep 30 2011