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 A124811 #21 Aug 12 2023 01:09:34 %S A124811 3,18,89,405,1701,6801,26244,98415,360846,1299078,4605822,16120350, %T A124811 55801305,191318760,650483703,2195382771,7360989291,24536630727, %U A124811 81358302690,268482398877,882156452724,2887057484028,9414317882700,30596533116588,99132767304831 %N A124811 Number of 4-ary Lyndon words of length n with exactly three 1s. %H A124811 G. C. Greubel, <a href="/A124811/b124811.txt">Table of n, a(n) for n = 4..1004</a> %H A124811 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (9,-27,30,-27,81,-81). %F A124811 O.g.f.: x^4*(3-9*x+8*x^2)/((1-3*x)^3*(1-3*x^3)). %F A124811 O.g.f.: (1/3)*((x/(1-3*x))^3 - x^3/(1-3*x^3)). %F A124811 a(n) = (1/3)*Sum_{d|3, d|n} mu(d) C(n/d-1,(n-3)/d)*3^((n-3)/d). %F A124811 a(n) = 3^(n/3-2)*(binomial(n-1, 2)*3^(2*n/3-2) - 1 + (n^2 mod 3)). %F A124811 a(n) = 3^(n-4)*binomial(n-1, 2) - b(n-6), where b(n) = A079978(n)*3^floor(n/3). - _G. C. Greubel_, Aug 08 2023 %e A124811 a(5) = 18 because 111ab and 11a1b are Lyndon of length 4 for ab=2,3,4. %t A124811 (3-9*x+8*x^2)/((1-3*x)^3*(1-3*x^3)) + O[x]^23//CoefficientList[#, x]& (* _Jean-François Alcover_, Sep 19 2017 *) %t A124811 LinearRecurrence[{9,-27,30,-27,81,-81}, {3,18,89,405,1701,6801}, 41] (* _G. C. Greubel_, Aug 08 2023 *) %o A124811 (Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( x^4*(3-9*x+8*x^2)/((1-3*x)^3*(1-3*x^3)) )); // _G. C. Greubel_, Aug 08 2023 %o A124811 (SageMath) %o A124811 def b(n): return (1/2)*(1 + (-1)^(n + (n+1)//3))*3^(n//3) %o A124811 def A124811(n): return 3^(n-4)*binomial(n-1,2) - b(n-6) %o A124811 [A124811(n) for n in range(4,41)] # _G. C. Greubel_, Aug 08 2023 %Y A124811 Cf. A079978, A124810, A124812, A124813, A124814, A001840, A124721. %K A124811 nonn,easy %O A124811 4,1 %A A124811 _Mike Zabrocki_, Nov 08 2006