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 A124812 #9 Aug 12 2023 01:09:45 %S A124812 3,21,135,702,3402,15282,65610,270540,1082565,4221639,16120377, %T A124812 60450138,223205220,813100356,2927177028,10428053400,36804946455, %U A124812 128817263385,447470664795,1543773631158,5292938720718,18044108743734,61193066237550 %N A124812 Number of 4-ary Lyndon words of length n with exactly four 1s. %H A124812 G. C. Greubel, <a href="/A124812/b124812.txt">Table of n, a(n) for n = 5..1005</a> %H A124812 <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (12,-48,36,234,-540,0,972,-729). %F A124812 O.g.f.: 3*x^5*(1 - 5*x + 9*x^2 - 6*x^3)/((1 - 3*x^2)^2*(1 - 3*x)^4). %F A124812 G.f.: (1/4)*( (x/(1-3*x))^4 - x^4/(1-3*x^2)^2 ). %F A124812 a(n) = (1/4)*Sum_{d|4,d|n} mu(d)*C(n/d - 1, (n-4)/d)*3^((n-4)/d). %F A124812 a(n) = (1/4)*C(n-1, 3)*3^(n-4) if n is odd, a(n) = (1/4)*( C(n-1, 3)*3^(n-4) - (n/2-1)*3^((n-4)/2) ) if n is even. %F A124812 a(n) = (3/4)*( 3^(n-5)*binomial(n-1, 3) - ((n-2)/2)*A254006(n-6) ). - _G. C. Greubel_, Aug 09 2023 %e A124812 a(6) = 21 because 1111ab, 1111ba, 111a1b, 111b1a, 11a11b for ab = 23, 24, 34 (accounting for 15 words) and 1111aa, 111a1a for a=2,3,4 (accounting for 6 words) are all Lyndon of length 6 %t A124812 3*(1-5*x+9*x^2-6*x^3)/((1-3*x)^4*(1-3*x^2)^2) + O[x]^23 // CoefficientList[#, x]& (* _Jean-François Alcover_, Sep 19 2017 *) %t A124812 LinearRecurrence[{12,-48,36,234,-540,0,972,-729}, {3,21,135,702,3402, 15282,65610,270540}, 41] (* _G. C. Greubel_, Aug 09 2023 *) %o A124812 (Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( 3*(1-5*x+9*x^2-6*x^3)/((1-3*x)^4*(1-3*x^2)^2) )); // _G. C. Greubel_, Aug 09 2023 %o A124812 (SageMath) %o A124812 def A124812(n): return (3/4)*(3^(n-5)*binomial(n-1,3) - ((n-2)//2)*3^((n-6)//2)*((n-5)%2)) %o A124812 [A124812(n) for n in range(5,41)] # _G. C. Greubel_, Aug 09 2023 %Y A124812 Cf. A006918, A124722, A124810, A124811, A124813, A124814, A254006. %K A124812 nonn %O A124812 5,1 %A A124812 _Mike Zabrocki_, Nov 08 2006