cp's OEIS Frontend

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.

Showing 1-4 of 4 results.

A124814 Triangle of number of 4-ary Lyndon words of length n containing exactly k 1s.

Original entry on oeis.org

1, 3, 1, 3, 3, 0, 8, 9, 3, 0, 18, 27, 12, 3, 0, 48, 81, 54, 18, 3, 0, 116, 243, 198, 89, 21, 3, 0, 312, 729, 729, 405, 135, 27, 3, 0, 810, 2187, 2538, 1701, 702, 189, 30, 3, 0, 2184, 6561, 8748, 6801, 3402, 1134, 251, 36, 3, 0, 5880, 19683, 29484, 26244, 15282, 6123, 1692
Offset: 0

Views

Author

Mike Zabrocki, Nov 08 2006

Keywords

Comments

Row sums given by A027377, first column given by A027376, second column given by A000244, third through sixth columns (k=2,3,4,5) given by A124810, A124811, A124812, A124813, third diagonal given by 3*A032766.

Examples

			T(4,2) = 12 because the words 11ab, 11ba, 1a1b for ab=23, 24, 34 and 11aa for a=2,3,4 are all Lyndon and of length 4 with exactly two 1s.
From _Andrew Howroyd_, Mar 26 2017: (Start)
Triangle starts
*   1
*   3    1
*   3    3    0
*   8    9    3    0
*  18   27   12    3   0
*  48   81   54   18   3   0
* 116  243  198   89  21   3  0
* 312  729  729  405 135  27  3 0
* 810 2187 2538 1701 702 189 30 3 0
(End)
		

Crossrefs

Programs

  • Maple
    C:=combinat[numbcomb]:mu:=numtheory[mobius]:divs:=numtheory[divisors]: T:=proc(n,k) local d; if k>0 then add(mu(d)*C(n/d-1,(n-k)/d)*3^((n-k)/d),d=divs(n) intersect divs(k))/k; elif n>0 then 1/n*add(mu(d)*3^(n/d),d=divs(n)); else 1; fi; end; [seq([seq(T(n,k),k=0..n)],n=0..10)];
  • Mathematica
    nmax = 10; col[0] = Table[If[n == 0, 1, 1/n* DivisorSum[n, MoebiusMu[#]* 3^(n/#)&]], {n, 0, nmax}]; col[k_] := x^k/k * DivisorSum[k, MoebiusMu[#] / (1 - 3*x^#)^(k/#)&] + O[x]^(nmax+2) // CoefficientList[#, x]&; Table[ col[k][[n+1]], {n, 0, nmax}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 19 2017 *)

Formula

T(n,0) = 1/n*Sum_{d|n} mu(d)*3^(n/d) = A027376(n).
T(n,n-1) = 3 for k>0.
T(n,k) = 1/k*Sum_{d|k,d|n} mu(d) C(n/d-1,(n-k)/d )*3^((n-k)/d) = 1/(n-k)*Sum_{d|k,d|n} mu(d) C(n/d-1,k/d)*3^((n-k)/d).
O.g.f. of columns: Sum_n T(n,k) x^n = x^k/k*Sum_{d|k} mu(d)*1/(1-3*x^d)^(k/d).
O.g.f. of diagonals: Sum_n T(n,n-k) x^n = x^k/k*Sum_{d|k} mu(d)*(3/(1-x^d))^(k/d).

A124810 Number of 4-ary Lyndon words of length n with exactly two 1s.

Original entry on oeis.org

3, 12, 54, 198, 729, 2538, 8748, 29484, 98415, 324648, 1062882, 3454002, 11160261, 35871174, 114791256, 365893848, 1162261467, 3680484804, 11622614670, 36611206686, 115063885233, 360882096930, 1129718145924, 3530368940292
Offset: 3

Views

Author

Mike Zabrocki, Nov 08 2006

Keywords

Comments

If the offsets are modified, A124810 to A124813 are the 2nd to 5th Witt transform of A000244 [Moree]. - R. J. Mathar, Nov 08 2008

Examples

			a(4) = 12 because 1122, 1123, 1124, 1132, 1133, 1134, 1142, 1143, 1144, 1213, 1214, 1314 are all 4-ary Lyndon words with length 4 and have exactly two 1s.
		

Crossrefs

Programs

  • Maple
    a:= n-> (Matrix([[12, 3, 0, 0]]). Matrix(4, (i,j)-> if (i=j-1) then 1 elif j=1 then [6, -6, -18, 27][i] else 0 fi)^(n-4))[1,1]: seq(a(n), n=3..26); # Alois P. Heinz, Aug 04 2008
  • Mathematica
    a[n_] := (1/2)*(n-1)*3^(n-2) - If[OddQ[n], 0, (1/2)*3^((n-2)/2)];
    Array[a, 24, 3] (* Jean-François Alcover, Sep 19 2017 *)

Formula

O.g.f.: 3 x^3 (1-2 x)/((1-3x)^2 (1-3x^2)) = 1/2*((x/(1-3*x))^2 - x^2/(1-3*x^2)).
a(n) = 1/2*sum_{d|2,d|n} mu(d) C(n/d-1,(n-2)/d )*3^((n-2)/d) =1/2*(n-1)*3^(n-2) if n is odd =1/2*(n-1)*3^(n-2) - 1/2*3^((n-2)/2) if n is even.
a(2n+1) = A230540(n)/2. - R. J. Mathar, Jul 20 2025

A124812 Number of 4-ary Lyndon words of length n with exactly four 1s.

Original entry on oeis.org

3, 21, 135, 702, 3402, 15282, 65610, 270540, 1082565, 4221639, 16120377, 60450138, 223205220, 813100356, 2927177028, 10428053400, 36804946455, 128817263385, 447470664795, 1543773631158, 5292938720718, 18044108743734, 61193066237550
Offset: 5

Views

Author

Mike Zabrocki, Nov 08 2006

Keywords

Examples

			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
		

Crossrefs

Programs

  • Magma
    R:=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
    
  • Mathematica
    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 *)
    LinearRecurrence[{12,-48,36,234,-540,0,972,-729}, {3,21,135,702,3402, 15282,65610,270540}, 41] (* G. C. Greubel, Aug 09 2023 *)
  • SageMath
    def A124812(n): return (3/4)*(3^(n-5)*binomial(n-1,3) - ((n-2)//2)*3^((n-6)//2)*((n-5)%2))
    [A124812(n) for n in range(5,41)] # G. C. Greubel, Aug 09 2023

Formula

O.g.f.: 3*x^5*(1 - 5*x + 9*x^2 - 6*x^3)/((1 - 3*x^2)^2*(1 - 3*x)^4).
G.f.: (1/4)*( (x/(1-3*x))^4 - x^4/(1-3*x^2)^2 ).
a(n) = (1/4)*Sum_{d|4,d|n} mu(d)*C(n/d - 1, (n-4)/d)*3^((n-4)/d).
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.
a(n) = (3/4)*( 3^(n-5)*binomial(n-1, 3) - ((n-2)/2)*A254006(n-6) ). - G. C. Greubel, Aug 09 2023

A124813 Number of 4-ary Lyndon words of length n with exactly five 1s.

Original entry on oeis.org

3, 27, 189, 1134, 6123, 30618, 144342, 649539, 2814669, 11821608, 48361131, 193444524, 758897748, 2927177028, 11123272701, 41712272649, 154580775111, 566796175407, 2058365058057, 7410114208989, 26464693603590, 93829368230910
Offset: 6

Views

Author

Mike Zabrocki, Nov 08 2006

Keywords

Examples

			a(7) = 27 because 11111ab, 1111a1b, 111a11b for a,b=2,3,4 are all Lyndon of length 7.
		

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( 3*x^6*(1-6*x+18*x^2-27*x^3+16*x^4)/((1-3*x)^5*(1-3*x^5)) )); // G. C. Greubel, Aug 17 2023
    
  • Mathematica
    3*(1 -6*x +18*x^2 -27*x^3 +16*x^4)/((1-3*x)^5*(1-3*x^5)) + O[x]^22 // CoefficientList[#, x]& (* Jean-François Alcover, Sep 19 2017 *)
  • SageMath
    def f(x): return 3*x^6*(1-6*x+18*x^2-27*x^3+16*x^4)/((1-3*x)^5*(1-3*x^5))
    def A124813_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( f(x) ).list()
    a=A124813_list(46); a[6:] # G. C. Greubel, Aug 17 2023

Formula

O.g.f.: 3*x^6*(1 - 6*x + 18*x^2 - 27*x^3 + 16*x^4)/((1 - 3*x)^5*(1 - 3*x^5)).
O.g.f.: (1/5)*((x/(1-3*x))^5 - x^5/(1-3*x^5)).
a(n) = (1/5)*Sum_{d|5, d|n} mu(d)*C(n/d-1, (n-5)/d )*3^((n-5)/d).
a(n) = (1/5)*C(n-1, 4)*3^(n-5) if n=1,2,3,4 mod 5.
a(n) = (1/5)*C(n-1, 4)*3^(n-5) - (1/5)*3^((n-5)/5) if n=0 mod 5.
Showing 1-4 of 4 results.