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

A226874 Number T(n,k) of n-length words w over a k-ary alphabet {a1, a2, ..., ak} such that #(w,a1) >= #(w,a2) >= ... >= #(w,ak) >= 1, where #(w,x) counts the letters x in word w; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 1, 3, 6, 0, 1, 10, 12, 24, 0, 1, 15, 50, 60, 120, 0, 1, 41, 180, 300, 360, 720, 0, 1, 63, 497, 1260, 2100, 2520, 5040, 0, 1, 162, 1484, 6496, 10080, 16800, 20160, 40320, 0, 1, 255, 5154, 20916, 58464, 90720, 151200, 181440, 362880
Offset: 0

Views

Author

Alois P. Heinz, Jun 21 2013

Keywords

Comments

T(n,k) is the sum of multinomials M(n; lambda), where lambda ranges over all partitions of n into parts that form a multiset of size k.

Examples

			T(4,2) = 10: aaab, aaba, aabb, abaa, abab, abba, baaa, baab, baba, bbaa.
T(4,3) = 12: aabc, aacb, abac, abca, acab, acba, baac, baca, bcaa, caab, caba, cbaa.
T(5,2) = 15: aaaab, aaaba, aaabb, aabaa, aabab, aabba, abaaa, abaab, ababa, abbaa, baaaa, baaab, baaba, babaa, bbaaa.
Triangle T(n,k) begins:
  1;
  0,  1;
  0,  1,   2;
  0,  1,   3,    6;
  0,  1,  10,   12,   24;
  0,  1,  15,   50,   60,   120;
  0,  1,  41,  180,  300,   360,   720;
  0,  1,  63,  497, 1260,  2100,  2520,  5040;
  0,  1, 162, 1484, 6496, 10080, 16800, 20160, 40320;
  ...
		

Crossrefs

Main diagonal gives: A000142.
Row sums give: A005651.
T(2n,n) gives A318796.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(t=1, 1/n!, add(b(n-j, j, t-1)/j!, j=i..n/t))
        end:
    T:= (n, k)-> `if`(n*k=0, `if`(n=k, 1, 0), n!*b(n, 1, k)):
    seq(seq(T(n, k), k=0..n), n=0..12);
    # second Maple program:
    b:= proc(n, i) option remember; expand(
          `if`(n=0, 1, `if`(i<1, 0, add(x^j*b(n-i*j, i-1)*
          combinat[multinomial](n, n-i*j, i$j), j=0..n/i))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2)):
    seq(T(n), n=0..12);
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[t == 1, 1/n!, Sum[b[n - j, j, t - 1]/j!, {j, i, n/t}]]; t[n_, k_] := If[n*k == 0, If[n == k, 1, 0], n!*b[n, 1, k]]; Table[Table[t[n, k], {k, 0, n}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Dec 13 2013, translated from first Maple *)
  • PARI
    T(n)={Vec(serlaplace(prod(k=1, n, 1/(1-y*x^k/k!) + O(x*x^n))))}
    {my(t=T(10)); for(n=1, #t, for(k=0, n-1, print1(polcoeff(t[n], k), ", ")); print)} \\ Andrew Howroyd, Dec 20 2017

Formula

T(n,k) = A226873(n,k) - [k>0] * A226873(n,k-1).

A213942 a(n) is the number of representative two-color bracelets (necklaces with turnover allowed) with n beads for n >= 2.

Original entry on oeis.org

1, 1, 3, 3, 7, 8, 18, 22, 46, 62, 136, 189, 409, 611, 1344, 2055, 4535, 7154, 15881, 25481, 56533, 92204, 204759, 337593, 748665, 1246862, 2762111, 4636389, 10253938, 17334800, 38278784, 65108061, 143534770, 245492243, 540353057, 928772649, 2041154125
Offset: 2

Views

Author

Wolfdieter Lang, Jul 31 2012

Keywords

Comments

This is the second column (m=2) of triangle A213940.
The relevant floor(n/2) representative color multinomials are c[1]^(n-1)*c[2], c[1]^(n-2)*c[2]^2, ..., c[1]^(n-floor(n/2))* c[2]^(floor(n/2)). For such representative bracelets the color c[1] is therefore preferred. Only for even n can c[2] appear as often as c[1], namely, n/2 times.
Note that beads with different colors are always present. This is in contrast to, e.g., A000029, where not only representatives but also one-color bracelets are counted. This sequences gives the number of binary bracelets with at least as many 0's as 1's and at least one 1 (bracelet analog of A226881). The number of two-color bracelets up to permutations of colors is given by A056357. For odd n these two sequences are equal. For a(8), the bracelets 00011011 and 11100100 are equivalent in A056357 but distinct in this sequence. - Andrew Howroyd and Wolfdieter Lang, Sep 25 2017

Examples

			a(5) = A213939(5,2) + A213939(5,3) = 1 + 2 = 3 from the representative bracelets (with colors j for c[j], j=1,2) cyclic(11112), cyclic(11122) and cyclic(11212). The first one has color signature (exponents) [4,1] and the two others have signature [3,2]. For the number of all two-color 5-bracelets with beads of five colors available see A214308(5) = 60.
a(8) = 18 =  1 + 4 + 5 + 8 for the partitions of 8 with 2 parts (7,1), (6, 2), (5,3), (4,4), respectively. see A213939(5, k), k = 2..5). The 8 representative bracelets for the exponents (signature) from partition (4,4) are B1 = (11112222), B2 = (11121222), B3 = (11212122), B4 = (11212212), B5 = (11221122), B6 = (12121212), B7 = (11122122) and B8 = (11211222). B1 to B6 are color exchange (1 <-> 2) invariant (modulo D_8 symmetry, i.e., cyclic or anti-cyclic operations). B7 is equivalent to B8 under color exchange.
This explains why A056357(8) = 17. The difference between the present sequence and A056357 is that there, besides D_n symmetry, also color exchange is allowed. Here only color exchange compatible with D_n symmetry is allowed. - _Wolfdieter Lang_, Sep 28 2017
		

Crossrefs

Cf. A213939, A213940, A214307 (m=3), A214308 (m=2, all bracelets).

Programs

  • Mathematica
    a29[n_] := (1/4)*(Mod[n, 2] + 3)*2^Quotient[n, 2] + DivisorSum[n, EulerPhi[#]*2^(n/#)&]/(2*n);
    a5648[n_] := 1/2*(Binomial[2*Quotient[n, 2], Quotient[n, 2]] + DivisorSum[n, EulerPhi[#]*Binomial[2*n/#, n/#]&]/(2*n));
    a[n_] := a29[n]/2 - 1 + If[EvenQ[n], a5648[n/2]/2, 0];
    Array[a, 37, 2] (* Jean-François Alcover, Nov 05 2017, after Andrew Howroyd *)

Formula

a(n) = A213940(n,2), n >= 2.
a(n) = Sum_{k=2..A008284(n,2)+1} A213939(n,k), n >= 2, with A008284(n,2) = floor(n/2).
a(2n) = (A000029(2n) + A005648(n)) / 2 - 1, a(2n+1) = A000029(2n+1) / 2 - 1. - Andrew Howroyd, Sep 25 2017

Extensions

Terms a(26) and beyond from Andrew Howroyd, Sep 25 2017

A191313 Sum of the abscissae of the first returns to the horizontal axis (assumed to be 0 if there are no such returns) in all dispersed Dyck paths of length n (i.e., Motzkin paths of length n with no (1,0) steps at positive heights).

Original entry on oeis.org

0, 0, 2, 5, 15, 30, 71, 134, 296, 551, 1188, 2211, 4720, 8815, 18722, 35105, 74307, 139842, 295223, 557366, 1174031, 2222606, 4672473, 8866776, 18607461, 35384676, 74139407, 141248270, 295524297, 563959752, 1178389423, 2252131246, 4700155088, 8995122383, 18751860084
Offset: 0

Views

Author

Emeric Deutsch, May 30 2011

Keywords

Comments

a(n) = Sum_{k>=0} k*A191312(n,k).

Examples

			a(4)=15 because the sum of the abscissae of the first returns in HHHH, HHUD, HUDH, UDHH, UDUD, and UUDD is 0+4+3+2+2+4=15; here H=(1,0), U=(1,1), and D=(1,-1).
		

Crossrefs

Cf. A191312.
Partial sums of A226881.

Programs

  • Maple
    g := z*(4*z-1+sqrt(1-4*z^2))/((1-z)^2*sqrt(1-4*z^2)*(1-2*z+sqrt(1-4*z^2))): gser := series(g, z = 0, 37): seq(coeff(gser, z, n), n = 0 .. 34);
  • Mathematica
    CoefficientList[Series[x*(4*x-1+Sqrt[1-4*x^2])/((1-x)^2*Sqrt[1-4*x^2]*(1-2*x+Sqrt[1-4*x^2])), {x, 0, 20}], x] (* Vaclav Kotesovec, Mar 20 2014 *)

Formula

G.f.: g = z*(4*z-1+q)/(q*(1-z)^2*(1-2*z+q)), where q=sqrt(1-4*z^2).
a(n) ~ 2^n * (1 + 1/sqrt(2*Pi*n) + 1/3*(-1)^n/sqrt(2*Pi*n)). - Vaclav Kotesovec, Mar 20 2014
Conjecture: n*(3*n-13)*a(n) +2*(-6*n^2+29*n-18)*a(n-1) +(3*n^2-13*n+24)*a(n-2) +2*(21*n^2-124*n+150)*a(n-3) +4*(-15*n^2+92*n-132) *a(n-4) +8*(n-3)*(3*n-10) *a(n-5)=0. - R. J. Mathar, Jun 14 2016
Showing 1-3 of 3 results.