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.

A292795 Number A(n,k) of sets of nonempty words with a total of n letters over k-ary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 3, 2, 0, 1, 1, 3, 7, 2, 0, 1, 1, 3, 13, 18, 3, 0, 1, 1, 3, 13, 36, 42, 4, 0, 1, 1, 3, 13, 60, 122, 110, 5, 0, 1, 1, 3, 13, 60, 206, 433, 250, 6, 0, 1, 1, 3, 13, 60, 326, 865, 1356, 627, 8, 0, 1, 1, 3, 13, 60, 326, 1345, 3408, 4449, 1439, 10, 0
Offset: 0

Views

Author

Alois P. Heinz, Sep 23 2017

Keywords

Examples

			A(2,3) = 3: {aa}, {ab}, {ba}.
A(3,2) = 7: {aaa}, {aab}, {aba}, {baa}, {aa,a}, {ab,a}, {ba,a}.
A(3,3) = 13: {aaa}, {aab}, {aba}, {baa}, {abc}, {acb}, {bac}, {bca}, {cab}, {cba}, {aa,a}, {ab,a}, {ba,a}.
Square array A(n,k) begins:
  1, 1,   1,    1,     1,     1,     1,     1,      1, ...
  0, 1,   1,    1,     1,     1,     1,     1,      1, ...
  0, 1,   3,    3,     3,     3,     3,     3,      3, ...
  0, 2,   7,   13,    13,    13,    13,    13,     13, ...
  0, 2,  18,   36,    60,    60,    60,    60,     60, ...
  0, 3,  42,  122,   206,   326,   326,   326,    326, ...
  0, 4, 110,  433,   865,  1345,  2065,  2065,   2065, ...
  0, 5, 250, 1356,  3408,  6228,  9468, 14508,  14508, ...
  0, 6, 627, 4449, 15025, 29845, 51325, 76525, 116845, ...
		

Crossrefs

Rows n=0-1 give: A000012, A057427.
Main diagonal gives A292796.

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:
    g:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), n!*b(n, 0, k)):
    h:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(h(n-i*j, i-1, k)*binomial(g(i, k), j), j=0..n/i)))
        end:
    A:= (n, k)-> h(n$2, min(n, k)):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • 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}]];
    g[n_, k_] := If[k == 0, If[n == 0, 1, 0], n!*b[n, 0, k]];
    h[n_, i_, k_] := h[n, i, k] = If[n == 0, 1, If[i < 1, 0, Sum[h[n - i*j, i - 1, k]*Binomial[g[i, k], j], {j, 0, n/i}]]];
    A[n_, k_] := h[n, n, Min[n, k]];
    Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 14}] // Flatten(* Jean-François Alcover, Jan 02 2021, after Alois P. Heinz *)

Formula

G.f. of column k: Product_{j>=1} (1+x^j)^A226873(j,k).
A(n,k) = Sum_{j=0..n} A319498(n,j).

A292713 Number of multisets of nonempty words with a total of n letters over n-ary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 4, 14, 67, 343, 2151, 14900, 119259, 1055520, 10465854, 113479756, 1350508150, 17373376892, 241576630993, 3596468789967, 57232276979726, 967517444008250, 17339617861447844, 328037083000497867, 6537494747743375847, 136820214583596515519
Offset: 0

Views

Author

Alois P. Heinz, Sep 21 2017

Keywords

Examples

			a(0) = 1: {}.
a(1) = 1: {a}.
a(2) = 4: {aa}, {ab}, {ba}, {a,a}.
a(3) = 14: {aaa}, {aab}, {aba}, {baa}, {abc}, {acb}, {bac}, {bca}, {cab}, {cba}, {aa,a}, {ab,a}, {ba,a}, {a,a,a}.
		

Crossrefs

Main diagonal of A292712.
Row sums of A319495.

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:
    g:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), n!*b(n, 0, k)):
    A:= proc(n, k) option remember; `if`(n=0, 1, add(add(d*
          g(d, k), d=numtheory[divisors](j))*A(n-j, k), j=1..n)/n)
        end:
    a:= n-> A(n$2):
    seq(a(n), n=0..25);
  • 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}]];
    g[n_, k_] := If[k == 0, If[n == 0, 1, 0], n!*b[n, 0, k]];
    A[n_, k_] := A[n, k] = If[n == 0, 1, Sum[Sum[d*g[d, k], {d, Divisors[j]}]* A[n - j, k], {j, 1, n}]/n];
    a[n_] := A[n, n];
    a /@ Range[0, 25] (* Jean-François Alcover, Dec 19 2020, after Alois P. Heinz *)

Formula

a(n) = [x^n] Product_{j=1..n} 1/(1-x^j)^A226873(j,n).
a(n) = A292712(n,n).
a(n) ~ c * n!, where c = A247551 = 2.5294774720791526... - Vaclav Kotesovec, Oct 05 2017

A319498 Number T(n,k) of sets of nonempty words with a total of n letters over k-ary alphabet such that for k>0 the k-th letter occurs at least once and within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 2, 5, 6, 0, 2, 16, 18, 24, 0, 3, 39, 80, 84, 120, 0, 4, 106, 323, 432, 480, 720, 0, 5, 245, 1106, 2052, 2820, 3240, 5040, 0, 6, 621, 3822, 10576, 14820, 21480, 25200, 40320, 0, 8, 1431, 13840, 41896, 86724, 124440, 186480, 221760, 362880
Offset: 0

Views

Author

Alois P. Heinz, Sep 20 2018

Keywords

Comments

T(n,k) is defined for n,k >= 0. The triangle contains only the terms with k <= n. T(n,k) = 0 for k > n.

Examples

			T(3,1) = 2: {aaa}, {aa,a}.
T(3,2) = 5: {aab}, {aba}, {baa}, {ab,a}, {ba,a}.
T(3,3) = 6: {abc}, {acb}, {bac}, {bca}, {cab}, {cba}.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1,    2;
  0, 2,    5,     6;
  0, 2,   16,    18,    24;
  0, 3,   39,    80,    84,   120;
  0, 4,  106,   323,   432,   480,    720;
  0, 5,  245,  1106,  2052,  2820,   3240,   5040;
  0, 6,  621,  3822, 10576, 14820,  21480,  25200,  40320;
  ...
		

Crossrefs

Columns k=0-1 give: A000007, A000009 (for n>0).
Row sums give A292796.
Main diagonal gives A000142.
First lower diagonal gives A038720 (for n>1).

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:
    g:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), n!*b(n, 0, k)):
    h:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(h(n-i*j, i-1, k)*binomial(g(i, k), j), j=0..n/i)))
        end:
    T:= (n, k)-> h(n$2, k) -`if`(k=0, 0, h(n$2, k-1)):
    seq(seq(T(n, k), k=0..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}]];
    g[n_, k_] := If[k == 0, If[n == 0, 1, 0], n!*b[n, 0, k]];
    h[n_, i_, k_] := h[n, i, k] = If[n == 0, 1, If[i < 1, 0,
         Sum[h[n - i*j, i - 1, k]*Binomial[g[i, k], j], {j, 0, n/i}]]];
    T[n_, k_] := h[n, n, k] - If[k == 0, 0, h[n, n, k - 1]];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Feb 09 2021, after Alois P. Heinz *)

Formula

T(n,k) = A292795(n,k) - A292795(n,k-1) for k > 0, T(n,0) = A000007(n).
Showing 1-3 of 3 results.