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 A284122 #13 Apr 07 2023 11:36:31 %S A284122 0,2,4,8,12,18,26,38,56,84,128,198,310,490,780,1248,2004,3226,5202, %T A284122 8398,13568,21932,35464,57358,92782,150098,242836,392888,635676, %U A284122 1028514,1664138,2692598,4356680,7049220,11405840,18454998,29860774,48315706,78176412,126492048,204668388,331160362,535828674 %N A284122 Number of binary words w of length n for which s, the longest proper suffix of w that appears at least twice in w, is of length 1 (i.e., either s = 0 or s = 1). %H A284122 Colin Barker, <a href="/A284122/b284122.txt">Table of n, a(n) for n = 1..1000</a> %H A284122 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-1,1). %F A284122 For n >= 2, a(n) = 2F(n-1)+2n-4, where F(n) is the n-th Fibonacci number. %F A284122 From _Colin Barker_, Mar 20 2017: (Start) %F A284122 G.f.: 2*x^2*(1 - x - x^3) / ((1 - x)^2*(1 - x - x^2)). %F A284122 a(n) = 2*(-2+(2^(-1-n)*((1-sqrt(5))^n*(1+sqrt(5)) + (-1+sqrt(5))*(1+sqrt(5))^n)) / sqrt(5) + n) for n>1. %F A284122 a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4) for n>4. %F A284122 (End) %e A284122 For n = 5, the 12 such strings are {00010,00011,00110,01011,01100,01110} and their binary complements. %t A284122 Rest@ CoefficientList[Series[2 x^2*(1 - x - x^3)/((1 - x)^2*(1 - x - x^2)), {x, 0, 43}], x] (* _Michael De Vlieger_, Mar 20 2017 *) %t A284122 LinearRecurrence[{3,-2,-1,1},{0,2,4,8,12},50] (* _Harvey P. Dale_, Apr 07 2023 *) %o A284122 (PARI) concat(0, Vec(2*x^2*(1 - x - x^3) / ((1 - x)^2*(1 - x - x^2)) + O(x^50))) \\ _Colin Barker_, Mar 20 2017 %K A284122 nonn,easy %O A284122 1,2 %A A284122 _Jeffrey Shallit_, Mar 20 2017