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-7 of 7 results.

A051168 Triangular array T(h,k) for 0 <= k <= h read by rows: T(h,k) = number of binary Lyndon words with k ones and h-k zeros.

Original entry on oeis.org

1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2, 3, 2, 1, 0, 0, 1, 3, 5, 5, 3, 1, 0, 0, 1, 3, 7, 8, 7, 3, 1, 0, 0, 1, 4, 9, 14, 14, 9, 4, 1, 0, 0, 1, 4, 12, 20, 25, 20, 12, 4, 1, 0, 0, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 0, 0, 1, 5, 18, 40, 66, 75, 66, 40, 18, 5, 1, 0, 0, 1, 6
Offset: 0

Views

Author

Keywords

Comments

T(h,k) is the number of classes of aperiodic binary words of k ones and h-k zeros; words u,v are in the same class if v is a cyclic permutation of u (e.g., u=111000, v=110001) and a word is aperiodic if not a juxtaposition of 2 or more identical subwords.
T(2n, n), T(2n+1, n), T(n, 3) match A022553, A000108, A001840, respectively. Row sums match A001037.
From R. J. Mathar, Jul 31 2008: (Start)
This triangle may also be regarded as the square array A(r,n), the n-th term of the r-th Witt transform of the all-1 sequence, r >= 1, n >= 0, read by antidiagonals:
This array begins as follows:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9
0 1 2 3 5 7 9 12 15 18 22 26 30 35 40 45 51 57 63
0 1 2 5 8 14 20 30 40 55 70 91 112 140 168 204 240 285 330
0 1 3 7 14 25 42 66 99 143 200 273 364 476 612 775 969 1197 1463
0 1 3 9 20 42 75 132 212 333 497 728 1026 1428 1932 2583 3384 4389 5598
0 1 4 12 30 66 132 245 429 715 1144 1768 2652 3876 5537 7752 10659 14421 19228
0 1 4 15 40 99 212 429 800 1430 2424 3978 6288 9690 14520 21318 30624 43263 60060
0 1 5 18 55 143 333 715 1430 2700 4862 8398 13995 22610 35530 54477 81719 120175
0 1 5 22 70 200 497 1144 2424 4862 9225 16796 29372 49742 81686 130750 204248
0 1 6 26 91 273 728 1768 3978 8398 16796 32065 58786 104006 178296 297160 482885
0 1 6 30 112 364 1026 2652 6288 13995 29372 58786 112632 208012 371384 643842
0 1 7 35 140 476 1428 3876 9690 22610 49742 104006 208012 400023 742900 1337220
0 1 7 40 168 612 1932 5537 14520 35530 81686 178296 371384 742900 1432613 2674440
...
It is essentially symmetric: A(r,r+i) = A(r,r-i+1).
Some of the diagonals are:
A(r,r+1): A000108
A(r,r): A022553
A(r,r-1): A000108
A(r,r+2): A000150
A(r,r+3): A050181
A(r,r+4): A050182
A(r,r+5): A050183
A(r,r-2): A000150 (End)
Fredman (1975) proved that the number S(n, k, v) of vectors (a_0, ..., a_{n-1}) of nonnegative integer components that satisfy a_0 + ... + a_{n-1} = k and Sum_{i=0..n-1} i*a_i = v (mod n) is given by S(n, k, v) = (1/(n + k)) * Sum_{d | gcd(n, k)} A054533(d, v) * binomial((n + k)/d, k/d) = S(k, n, v). This was also proved by Elashvili et al. (1999), who also proved that S(n, k, v) = Sum_{d | gcd(n, k, v)} S(n/d, k/d, 1). Here, S(n, k, 1) = T(n + k, k). - Petros Hadjicostas, Jul 09 2019

Examples

			Triangle begins with:
h=0: 1
h=1: 1, 1
h=2: 0, 1, 0
h=3: 0, 1, 1, 0
h=4: 0, 1, 1, 1,  0
h=5: 0, 1, 2, 2,  1,  0
h=6: 0, 1, 2, 3,  2,  1, 0
h=7: 0, 1, 3, 5,  5,  3, 1, 0
h=8: 0, 1, 3, 7,  8,  7, 3, 1, 0
h=9: 0, 1, 4, 9, 14, 14, 9, 4, 1, 0
...
T(6,3) counts classes {111000},{110100},{110010}, each of 6 aperiodic. The class {100100} contains 3 periodic words, counted by T(3,1) as {100}, consisting of 3 aperiodic words 100,010,001.
		

Crossrefs

Columns 1-11: A000012, A004526(n-1), A001840(n-4), A006918(n-4), A011795(n-1), A011796(n-6), A011797(n-1), A031164(n-9), A011845, A032168, A032169. See also A000150.

Programs

  • Maple
    A := proc(r,n) local gf,d,genf; genf := 1/(1-x) ; gf := 0 ; for d in numtheory[divisors](r) do gf := gf + numtheory[mobius](d)*(subs(x= x^d,genf))^(r/d) ; od: gf := expand(gf/r) ; coeftayl(gf,x=0,n) ; end proc:
    A051168 := proc(n,k) if n<=1 then 1; elif n=0 or n=k then 0; else A(n-k,k) ; end if;
    end proc:
    seq(seq(A051168(n,k),k=0..n),n=0..10) ; # R. J. Mathar, Mar 29 2011
  • Mathematica
    Table[If[n===0,1,1/n Plus@@(MoebiusMu[ # ]Binomial[n/#,k/# ]&/@ Divisors[GCD[n,k]])],{n,0,12},{k,0,n}] (* Wouter Meeussen, Jul 20 2008 *)
  • PARI
    {T(n, k) = local(A, ps, c); if( k<0 || k>n, 0, if( n==0 && k==0, 1, A = x * O(x^n) + y * O(y^n); ps = 1 - x - y + A; for( m=1, n, for( i=0, m, c = polcoeff( polcoeff(ps, i, x), m-i, y); if( m==n && i==k, break(2), ps *= (1 -y^(m-i) * x^i + A)^c))); -c))} /* Michael Somos, Jul 03 2004 */
    
  • PARI
    T(n,k) = if (n==0, 1, (1/n) * sumdiv(gcd(n,k), d, moebius(d) * binomial(n/d,k/d)));
    tabl(nn) = for (n=0, nn, for (k=0, n, print1(T(n, k), ", ")); print); \\ Michel Marcus, May 16 2018

Formula

T(h, k) = 1 for (h, k) in {(0, 0), (1, 0), (1, 1)}; T(h, k) = 0 if h >= 2 and k = 0 or k = h. Otherwise, T(h, k) = (1/h)*(C(h, k)-S(h, k)), where S(h, k) = Sum_{d <= 2, d|h, d|k} (h/d)*T(h/d, k/d).
1 - x - y = Product_{i,j} (1 - x^i * y^j)^T(i+j, j) where i >= 0, j >= 0 are not both zero. - Michael Somos, Jul 03 2004
The prime rows are given by (1+x)^p/p with noninteger coefficients rounded to zero. E.g., for h = 2 below, (1 + x)^2/2 = (1 + 2*x + x^2)/2 = 0.5 + x + 0.5*x^2 gives (0,1,0). - Tom Copeland, Oct 21 2014
T(n,k) = (1/n) * Sum_{d | gcd(n,k)} mu(d) * binomial(n/d, k/d), for n > 0. - Andrew Howroyd, Mar 26 2017
From Petros Hadjicostas, Jun 16 2019: (Start)
O.g.f. for column k >= 1: (x^k/k) * Sum_{d|k} mu(d)/(1 - x^d)^(k/d).
Bivariate o.g.f.: Sum_{n,k >= 0} T(n, k)*x^n*y^k = 1 - Sum_{d >= 1} (mu(d)/d) *log(1 - x^d * (1 + y^d)).
(End)

A011847 Triangle of numbers read by rows: T(n,k) = floor( C(n,k)/(k+1) ), where k=0..n-1 and n >= 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 3, 2, 1, 1, 3, 5, 5, 3, 1, 1, 3, 7, 8, 7, 3, 1, 1, 4, 9, 14, 14, 9, 4, 1, 1, 4, 12, 21, 25, 21, 12, 4, 1, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 1, 5, 18, 41, 66, 77, 66, 41, 18, 5, 1, 1, 6, 22, 55, 99, 132, 132, 99, 55, 22, 6, 1, 1, 6, 26, 71, 143, 214, 245, 214, 143, 71, 26, 6, 1
Offset: 1

Views

Author

Keywords

Comments

When k+1 is a prime >= 2, then T(n,k) = floor(C(n,k)/(k+1)) is the number of aperiodic necklaces of n+1 beads of 2 colors such that k+1 of them are black and n-k of them are white. This is not true when k+1 is a composite >= 4. For more details, see the comments for sequences A032168 and A032169. - Petros Hadjicostas, Aug 27 2018
Differs from A245558 from row n = 9, k = 4 on. - M. F. Hasler, Sep 29 2018

Examples

			Triangle begins:
  1;
  1, 1;
  1, 1,  1;
  1, 2,  2,   1;
  1, 2,  3,   2,   1;
  1, 3,  5,   5,   3,   1;
  1, 3,  7,   8,   7,   3,    1;
  1, 4,  9,  14,  14,   9,    4,    1;
  1, 4, 12,  21,  25,  21,   12,    4,    1;
  1, 5, 15,  30,  42,  42,   30,   15,    5,    1;
  1, 5, 18,  41,  66,  77,   66,   41,   18,    5,   1;
  1, 6, 22,  55,  99, 132,  132,   99,   55,   22,   6,   1;
  1, 6, 26,  71, 143, 214,  245,  214,  143,   71,  26,   6,   1;
  1, 7, 30,  91, 200, 333,  429,  429,  333,  200,  91,  30,   7,  1;
  1, 7, 35, 113, 273, 500,  715,  804,  715,  500, 273, 113,  35,  7, 1;
  1, 8, 40, 140, 364, 728, 1144, 1430, 1430, 1144, 728, 364, 140, 40, 8, 1;
...
More than the usual number of rows are shown in order to distinguish this triangle from A245558, from which it differs in rows 9, 11, 13, ....
From _Petros Hadjicostas_, Aug 27 2018: (Start)
For k+1 = 2 and n >= k+1 = 2, the n-th element of column k=1 above, [0, 1, 1, 2, 2, 3, 3, 4, 4, ...] (i.e., the number A008619(n-2) = floor(n/2)), gives the number of aperiodic necklaces of n+1 beads of 2 colors such that 2 of them are black and n-1 of them are white. (The offset of sequence A008619 is 0.)
For k+1 = 3 and n >= k+1 = 3, the n-th element of column k=2 above, [0, 0, 1, 2, 3, 5, 7, 9, 12, ...] (i.e., the number A001840(n-2) = floor(C(n,2)/3)), gives the number of aperiodic necklaces of n+1 beads of 2 colors such that 3 of them are black and n-2 of them are white. (The offset of sequence A001840 is 0.)
For k+1 = 5 and n >= k+1 = 5, the n-th element of column k=4 above, [0, 0, 0, 0, 1, 3, 7, 14, 25, 42, ... ] (i.e., the number A011795(n) = floor(C(n,4)/5)), gives the number of aperiodic necklaces of n+1 beads of 2 colors such that 5 of them are black and n-4 of them are white. (The offset of sequence A011795 is 0.)
Counterexample for k+1 = 4: It can be proved that, for n >= k+1 = 4, the number of aperiodic necklaces of n+1 beads of 2 colors such that 4 of them are black and n-3 of them are white is (1/4)*Sum_{d|4} mu(d)*I(d|n+1)*C(floor((n+1)/d) - 1, 4/d - 1) = (1/4)*(C(n, 3) - I(2|n+1)*floor((n-1)/2)), where I(a|b) = 1 if integer a divides integer b, and 0 otherwise. For n odd >= 9, the number (1/4)*(C(n, 3) - I(2|n+1)*floor((n-1)/2)) = A006918(n-3) is not equal to floor(C(n,3)/4) = A011842(n).
(End)
		

Crossrefs

Sums: A095718 (row), A095719 (diagonal).

Programs

  • Magma
    A011847:= func< n,k | Floor(Binomial(n+1,k+1)/(n+1)) >;
    [A011847(n,k): k in [0..n-1], n in [1..20]]; // G. C. Greubel, Oct 20 2024
    
  • Mathematica
    Table[Floor[Binomial[n,k]/(k+1)],{n,20},{k,0,n-1}]//Flatten (* Harvey P. Dale, Jan 09 2019 *)
  • PARI
    A011847(n,k)=binomial(n,k)\(k+1) \\ M. F. Hasler, Sep 30 2018
    
  • SageMath
    def A011847(n,k): return binomial(n+1,k+1)//(n+1)
    flatten([[A011847(n,k) for k in range(n)] for n in range(1,21)]) # G. C. Greubel, Oct 20 2024

Formula

The rows are palindromic: T(n, k) = T(n, n-k-1) for n >= 1 and 0 <= k <= n-1.
Sum_{k=0..floor((n-1)/2)} T(n-k, k) = A095719(n). - G. C. Greubel, Oct 20 2024

A011915 a(n) = floor(n*(n-1)*(n-2)*(n-3)/5).

Original entry on oeis.org

0, 0, 0, 0, 4, 24, 72, 168, 336, 604, 1008, 1584, 2376, 3432, 4804, 6552, 8736, 11424, 14688, 18604, 23256, 28728, 35112, 42504, 51004, 60720, 71760, 84240, 98280, 114004, 131544, 151032, 172608, 196416, 222604, 251328, 282744, 317016, 354312
Offset: 0

Views

Author

Keywords

Crossrefs

Sequences of the form floor(24*binomial(n,4)/m): A052762 (m=1), A033486 (m=2), A162668 (m=3), A033487 (m=4), this sequence (m=5), A033488 (m=6), A011917 (m=7), A050534 (m=8), A011919 (m=9), 2*A011930 (m=10), A011921 (m=11), A034827 (m=12), A011923 (m=13), A011924 (m=14), A011925 (m=15), A011926 (m=16), A011927 (m=17), A011928 (m=18), A011929 (m=19), A011930 (m=20), A011931 (m=21), A011932 (m=22), A011933 (m=23), A000332 (m=24), A011935 (m=25),A011936 (m=26), A011937 (m=27), A011938 (m=28), A011939 (m=29), A011940 (m=30), A011941 (m=31), A011942 (m=32), A011795 (m=120).

Programs

  • Magma
    [Floor(n*(n-1)*(n-2)*(n-3)/5): n in [0..60]]; // Vincenzo Librandi, Jun 19 2012
    
  • Mathematica
    Table[Floor[n(n-1)(n-2)(n-3)/5], {n,60}] (* Stefan Steinerberger, Apr 10 2006 *)
    CoefficientList[Series[4*x^4*(1+2*x+2*x^3+x^4)/((1-x)^4*(1+x^5)),{x,0,60}],x] (* Vincenzo Librandi, Jun 19 2012 *)
  • SageMath
    [24*binomial(n,4)//5 for n in range(61)] # G. C. Greubel, Oct 20 2024

Formula

a(n) = +4*a(n-1) -6*a(n-2) +4*a(n-3) -a(n-4) +a(n-5) -4*a(n-6) +6*a(n-7) -4*a(n-8) +a(n-9).
G.f.: 4*x^4*(1+2*x+2*x^3+x^4) / ( (1-x)^5*(1+x+x^2+x^3+x^4) ). - R. J. Mathar, Apr 15 2010
a(n) = 4*A011930(n). - G. C. Greubel, Oct 20 2024

Extensions

More terms from Stefan Steinerberger, Apr 10 2006
Zero added in front by R. J. Mathar, Apr 15 2010

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.

A051170 T(n,5), array T as in A051168; a count of Lyndon words; aperiodic necklaces with 5 black beads and n-5 white beads.

Original entry on oeis.org

0, 1, 3, 7, 14, 25, 42, 66, 99, 143, 200, 273, 364, 476, 612, 775, 969, 1197, 1463, 1771, 2125, 2530, 2990, 3510, 4095, 4750, 5481, 6293, 7192, 8184, 9275, 10472, 11781, 13209, 14763, 16450, 18278, 20254, 22386, 24682
Offset: 5

Views

Author

Keywords

Crossrefs

Cf. A000031, A001037, A051168. Same as A011795(n-1).
First differences of A036837.

Programs

  • Magma
    [ Floor(Binomial(n,5)/n): n in [5..30]]; // G. C. Greubel, Nov 26 2017
  • Mathematica
    Table[Floor[Binomial[n, 5]/n], {n, 5, 50}] (* G. C. Greubel, Nov 26 2017 *)
  • PARI
    for(n=5,30, print1(floor(binomial(n,5)/n), ", ")) \\ G. C. Greubel, Nov 26 2017
    

Formula

G.f.: -x^6*(x^2-x+1) / ((x-1)^5*(x^4+x^3+x^2+x+1)). - Colin Barker, Jun 05 2013
a(n) = floor(C(n,5)/n). - Alois P. Heinz, Jun 05 2013
G.f.: x^5/5 * (1/(1-x)^5 - 1/(1-x^5)). - Herbert Kociemba, Oct 16 2016

A011940 a(n) = floor(n*(n-1)*(n-2)*(n-3)/30).

Original entry on oeis.org

0, 0, 0, 0, 0, 4, 12, 28, 56, 100, 168, 264, 396, 572, 800, 1092, 1456, 1904, 2448, 3100, 3876, 4788, 5852, 7084, 8500, 10120, 11960, 14040, 16380, 19000, 21924, 25172, 28768, 32736, 37100, 41888, 47124, 52836, 59052, 65800, 73112, 81016, 89544, 98728, 108600, 119196, 130548, 142692, 155664, 169500
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [Floor(n*(n-1)*(n-2)*(n-3)/30): n in [0..60]]; // Vincenzo Librandi, Jun 19 2012
    
  • Mathematica
    CoefficientList[Series[4*x^5*(1-x+x^2)/((1-x)^4*(1-x^5)),{x,0,60}],x] (* Vincenzo Librandi, Jun 19 2012 *)
    LinearRecurrence[{4,-6,4,-1,1,-4,6,-4,1},{0,0,0,0,0,4,12,28,56},60] (* Harvey P. Dale, Nov 13 2017 *)
    Floor[4*Binomial[Range[0,60], 4]/5] (* G. C. Greubel, Oct 27 2024 *)
  • SageMath
    [4*binomial(n,4)//5 for n in range(61)] # G. C. Greubel, Oct 27 2024

Formula

a(n) = 4 * A011795(n).
From R. J. Mathar, Apr 15 2010: (Start)
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) + a(n-5) - 4*a(n-6) + 6*a(n-7) - 4*a(n-8) + a(n-9).
G.f.: 4*x^5*(1-x+x^2) / ((1-x)^5*(1+x+x^2+x^3+x^4) ). (End)

A263318 Number of aperiodic necklaces (Lyndon words) with 9 black beads and n white beads.

Original entry on oeis.org

0, 1, 5, 18, 55, 143, 333, 715, 1430, 2700, 4862, 8398, 13995, 22610, 35530, 54477, 81719, 120175, 173583, 246675, 345345, 476901, 650325, 876525, 1168695, 1542684, 2017356, 2615085, 3362260, 4289780, 5433714, 6835972, 8544965, 10616463, 13114465, 16112057
Offset: 0

Views

Author

Criel Merino, Pedro Antonio, Oct 14 2015

Keywords

Comments

A row of triangle A051168.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(x (x^4 - x^3 + 3*x^2 - x + 1))/((x^2 + x + 1)^3 (1 - x)^9), {x, 0, 40}], x] (* Wesley Ivan Hurt, Oct 15 2015 *)
    CoefficientList[Series[((-1+x^3)^-3-(-1+x)^-9)/9,{x,0,40}],x] (* Herbert Kociemba, Oct 16 2016 *)
    LinearRecurrence[{6,-15,23,-33,51,-64,63,-63,64,-51,33,-23,15,-6,1},{0,1,5,18,55,143,333,715,1430,2700,4862,8398,13995,22610,35530},40] (* Harvey P. Dale, Feb 10 2023 *)
  • PARI
    a(n)= (1/(n+9))*sumdiv(gcd(n+9,9), d, moebius(d)*binomial( (n+9)/d , 9/d )); \\ Michel Marcus, Oct 14 2015
    
  • Python
    from sympy import mobius, binomial, gcd, divisors
    print([sum(mobius(d) * binomial((n + 9)//d, 9//d) for d in divisors(gcd(n + 9, 9))) // (n + 9) for n in range(51)]) # Indranil Ghosh, Mar 26 2017

Formula

a(n) = (1/(n+9))*Sum_{d divides gcd(n+9,9)} mu(d)*binomial((n+9)/d, 9/d).
G.f.: (x*(x^4-x^3+3*x^2-x+1))/((x^2+x+1)^3*(1-x)^9).
G.f.: ((-1+x^3)^-3-(-1+x)^-9)/9. - Herbert Kociemba, Oct 16 2016

Extensions

More terms from Michel Marcus, Oct 14 2015
Showing 1-7 of 7 results.