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 A386270 #10 Aug 19 2025 16:43:04 %S A386270 0,1,4,9,22,52,120,272,608,1344,2944,6400,13824,29696,63488,135168, %T A386270 286720,606208,1277952,2686976,5636096,11796480,24641536,51380224, %U A386270 106954752,222298112,461373440,956301312,1979711488,4093640704,8455716864,17448304640,35970351104 %N A386270 Total number of ones in runs of 1s of length <=2 over all binary strings of length n. %H A386270 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (4,-4). %F A386270 a(n) = n*2^(n-1) for n<3 and a(n) = (6+4*n)*2^(n-4) for n>=3. %e A386270 For n=4, the binary strings that contain runs of 1s of length <=2 are: 0001, 0010, 0011, 0100, 0101, 0110, 1000, 1001, 1010, 1011, 1100, and 1101. The total number of ones in the runs of 1s of length <=2 is thus a(4)=22. %Y A386270 Cf. A045623, A001787. %K A386270 nonn,easy %O A386270 0,3 %A A386270 _Félix Balado_, Aug 14 2025