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-10 of 12 results. Next

A293113 Number T(n,k) of sets of nonempty words with a total of n letters over k-ary alphabet containing the k-th letter such that within each prefix of a 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, 1, 0, 2, 3, 1, 0, 2, 8, 4, 1, 0, 3, 20, 16, 5, 1, 0, 4, 47, 53, 25, 6, 1, 0, 5, 106, 173, 102, 36, 7, 1, 0, 6, 237, 532, 410, 172, 49, 8, 1, 0, 8, 522, 1615, 1545, 813, 268, 64, 9, 1, 0, 10, 1146, 4785, 5784, 3576, 1448, 394, 81, 10, 1
Offset: 0

Views

Author

Alois P. Heinz, Sep 30 2017

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1,   1;
  0, 2,   3,   1;
  0, 2,   8,   4,   1;
  0, 3,  20,  16,   5,   1;
  0, 4,  47,  53,  25,   6,  1;
  0, 5, 106, 173, 102,  36,  7, 1;
  0, 6, 237, 532, 410, 172, 49, 8, 1;
  ...
		

Crossrefs

Columns k=0-10 give: A000007, A000009 (for n>0), A293883, A293884, A293885, A293886, A293887, A293888, A293889, A293890, A293891.
Row sums give A293114.
T(2n,n) gives A293115.

Programs

  • Maple
    h:= l-> (n-> add(i, i=l)!/mul(mul(1+l[i]-j+add(`if`(l[k]
        n, 0, g(n-i, i, [l[], i])))))
        end:
    b:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(b(n-i*j, i-1, k)*binomial(g(i, k, []), j), j=0..n/i)))
        end:
    T:= (n, k)-> b(n$2, k)-`if`(k=0, 0, b(n$2, k-1)):
    seq(seq(T(n, k), k=0..n), n=0..14);
  • Mathematica
    h[l_] := Function[n, Total[l]!/Product[Product[1 + l[[i]] - j + Sum[If[ l[[k]] n, 0, g[n - i, i, Append[l, i]]]]]];
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i<1, 0, Sum[b[n - i*j, i-1, k]*Binomial[g[i, k, {}], j], {j, 0, n/i}]]];
    T[n_, k_] := b[n, n, k] - If[k == 0, 0, b[n, n, k - 1]];
    Table[T[n, k], {n, 0, 14}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 04 2018, after Alois P. Heinz *)

Formula

T(n,k) = A293112(n,k) - A293112(n,k-1) for k>0, T(n,0) = A293112(n,0).

A293108 Number A(n,k) of multisets of nonempty words with a total of n letters over k-ary alphabet such that within each prefix of a 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, 2, 0, 1, 1, 3, 3, 0, 1, 1, 3, 6, 5, 0, 1, 1, 3, 7, 15, 7, 0, 1, 1, 3, 7, 19, 31, 11, 0, 1, 1, 3, 7, 20, 48, 73, 15, 0, 1, 1, 3, 7, 20, 53, 131, 155, 22, 0, 1, 1, 3, 7, 20, 54, 157, 348, 351, 30, 0, 1, 1, 3, 7, 20, 54, 163, 455, 954, 755, 42, 0
Offset: 0

Views

Author

Alois P. Heinz, Sep 30 2017

Keywords

Examples

			Square array A(n,k) begins:
  1,  1,   1,   1,   1,   1,   1,   1, ...
  0,  1,   1,   1,   1,   1,   1,   1, ...
  0,  2,   3,   3,   3,   3,   3,   3, ...
  0,  3,   6,   7,   7,   7,   7,   7, ...
  0,  5,  15,  19,  20,  20,  20,  20, ...
  0,  7,  31,  48,  53,  54,  54,  54, ...
  0, 11,  73, 131, 157, 163, 164, 164, ...
  0, 15, 155, 348, 455, 492, 499, 500, ...
		

Crossrefs

Main diagonal gives A293110.

Programs

  • Maple
    h:= l-> (n-> add(i, i=l)!/mul(mul(1+l[i]-j+add(`if`(l[k]
        n, 0, g(n-i, i, [l[], i])))))
        end:
    A:= proc(n, k) option remember; `if`(n=0, 1, add(add(g(d, k, [])
          *d, d=numtheory[divisors](j))*A(n-j, k), j=1..n)/n)
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    h[l_] := Function [n, Total[l]!/Product[Product[1 + l[[i]] - j + Sum[If[ l[[k]] < j, 0, 1], {k, i+1, n}], {j, 1, l[[i]]}], {i, n}]][Length[l]];
    g[n_, i_, l_] := g[n, i, l] = If[n == 0, h[l], If[i < 1, 0, If[i == 1, h[Join[l, Table[1, n]]], g[n, i - 1, l] + If[i > n, 0, g[n - i, i, Append[l, i]]]]]];
    A[n_, k_] := A[n, k] = If[n == 0, 1, Sum[Sum[g[d, k, {}]*d, {d, Divisors[j] }]*A[n - j, k], {j, 1, n}]/n];
    Table[A[n, d-n], {d, 0, 14}, {n, 0, d}] // Flatten (* Jean-François Alcover, Jun 03 2018, from Maple *)

Formula

G.f. of column k: Product_{j>=1} 1/(1-x^j)^A182172(j,k).
A(n,k) = Sum_{j=0..k} A293109(n,j).
A(n,n) = A(n,k) for all k >= n.

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

Original entry on oeis.org

1, 1, 2, 6, 15, 45, 136, 430, 1415, 4845, 17235, 63509, 242854, 959904, 3926209, 16564083, 72097127, 322898943, 1487602607, 7034420691, 34122991199, 169499127425, 861596397518, 4475340840980, 23738200183570, 128427236055296, 708248486616539, 3977551340260517
Offset: 0

Views

Author

Alois P. Heinz, Sep 30 2017

Keywords

Examples

			a(0) = 1: {}.
a(1) = 1: {a}.
a(2) = 2: {aa}, {ab}.
a(3) = 6: {a,aa}, {a,ab}, {aaa}, {aab}, {aba}, {abc}.
		

Crossrefs

Main diagonal of A293112.
Row sums of A293113 and of A293815.

Programs

  • Maple
    g:= proc(n) option remember;
          `if`(n<2, 1, g(n-1)+(n-1)*g(n-2))
        end:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(b(n-i*j, i-1)*binomial(g(i), j), j=0..n/i)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..35);
  • Mathematica
    g[n_] := g[n] = If[n < 2, 1, g[n - 1] + (n - 1)*g[n - 2]];
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1]* Binomial[g[i], j], {j, 0, n/i}]]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 06 2018, from Maple *)

Formula

G.f.: Product_{j>=1} (1+x^j)^A000085(j).
Weigh transform of A000085.

A293741 Number of sets of nonempty words with a total of n letters over binary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 2, 5, 10, 23, 51, 111, 243, 530, 1156, 2497, 5421, 11662, 25179, 53991, 116035, 248025, 531045, 1131943, 2415495, 5135914, 10927905, 23182313, 49199819, 104154950, 220543471, 465997148, 984704560, 2076988713, 4380764650, 9225209928, 19424814305
Offset: 0

Views

Author

Alois P. Heinz, Oct 15 2017

Keywords

Crossrefs

Column k=2 of A293112.
Cf. A001405.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, add(
          b(n-i*j, i-1)*binomial(binomial(i, floor(i/2)), j), j=0..n/i)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..35);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1]* Binomial[Binomial[i, Floor[i/2]], j], {j, 0, n/i}]]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, May 29 2019, after Alois P. Heinz *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import binomial
    @cacheit
    def b(n, i): return 1 if n==0 else 0 if i<1 else sum([b(n - i*j, i - 1)*binomial(binomial(i, i//2), j) for j in range(n//i + 1)])
    def a(n): return b(n, n)
    print([a(n) for n in range(36)]) # Indranil Ghosh, Oct 15 2017

Formula

G.f.: Product_{j>=1} (1+x^j)^A001405(j).

A293744 Number of sets of nonempty words with a total of n letters over quinary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 2, 6, 15, 45, 135, 422, 1357, 4503, 15301, 53225, 189070, 684540, 2522194, 9441960, 35867225, 138080428, 538155330, 2121211604, 8448577175, 33974559322, 137842934746, 563885092371, 2324435490519, 9650120731330, 40329864236526, 169593208033062
Offset: 0

Views

Author

Alois P. Heinz, Oct 15 2017

Keywords

Crossrefs

Column k=5 of A293112.

Programs

  • Maple
    g:= proc(n) option remember;
          `if`(n<3, [1, 1, 2][n+1], ((3*n^2+17*n+15)*g(n-1)
           +(n-1)*(13*n+9)*g(n-2) -15*(n-1)*(n-2)*g(n-3)) /
           ((n+4)*(n+6)))
        end:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(b(n-i*j, i-1)*binomial(g(i), j), j=0..n/i)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..35);
  • Mathematica
    g[n_] := g[n] = If[n<3, {1, 1, 2}[[n+1]], ((3*n^2 + 17*n + 15)*g[n-1] + (n-1)*(13*n + 9)*g[n-2] - 15*(n-1)*(n-2)*g[n-3]) / ((n+4)*(n+6))];
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1]* Binomial[g[i], j], {j, 0, n/i}]]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 06 2018, from Maple *)

Formula

G.f.: Product_{j>=1} (1+x^j)^A049401(j).

A293745 Number of sets of nonempty words with a total of n letters over senary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 2, 6, 15, 45, 136, 429, 1406, 4771, 16749, 60453, 224948, 857010, 3350574, 13366375, 54494538, 226020624, 954737292, 4092229831, 17813005015, 78509835288, 350592604663, 1582430253294, 7223028969003, 33275812688050, 154790795962448, 725871751770492
Offset: 0

Views

Author

Alois P. Heinz, Oct 15 2017

Keywords

Crossrefs

Column k=6 of A293112.

Programs

  • Maple
    g:= proc(n) option remember;
          `if`(n<4, [1, 1, 2, 4][n+1], ((20*n^2+184*n+336)*g(n-1)
           +4*(n-1)*(10*n^2+58*n+33)*g(n-2) -144*(n-1)*(n-2)*g(n-3)
           -144*(n-1)*(n-2)*(n-3)*g(n-4))/ ((n+5)*(n+8)*(n+9)))
        end:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(b(n-i*j, i-1)*binomial(g(i), j), j=0..n/i)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..35);
  • Mathematica
    h[l_] := Function[n, Total[l]!/Product[Product[1 + l[[i]] - j + Sum[If[ l[[k]] < j, 0, 1], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]][Length[l]];
    g[n_, i_, l_] := g[n, i, l] = If[n == 0, h[l], If[i < 1, 0, If[i == 1, h[Join[l, Table[1, n]]], g[n, i - 1, l] + If[i > n, 0, g[n - i, i, Append[l, i]]]]]];
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1, k]*Binomial[g[i, k, {}], j], {j, 0, n/i}]]];
    a[n_] := b[n, n, 6];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 06 2018, using code from A293112 *)

Formula

G.f.: Product_{j>=1} (1+x^j)^A007579(j).

A293746 Number of sets of nonempty words with a total of n letters over septenary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 2, 6, 15, 45, 136, 430, 1414, 4835, 17143, 62843, 238245, 930418, 3741710, 15445815, 65384356, 283113205, 1252393193, 5648731817, 25945636702, 121172059749, 574764521186, 2765620022767, 13486540312370, 66587056756662, 332594340605540, 1679325348600290
Offset: 0

Views

Author

Alois P. Heinz, Oct 15 2017

Keywords

Crossrefs

Column k=7 of A293112.

Programs

  • Maple
    g:= proc(n) option remember; `if`(n<4, [1, 1, 2, 4][n+1],
          ((4*n^3+78*n^2+424*n+495)*g(n-1) +(n-1)*(34*n^2+280*n+
           305)*g(n-2) -2*(n-1)*(n-2)*(38*n+145)*g(n-3) -105*(n-1)
           *(n-2)*(n-3)*g(n-4))/((n+6)*(n+10)*(n+12)))
        end:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(b(n-i*j, i-1)*binomial(g(i), j), j=0..n/i)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..35);
  • Mathematica
    h[l_] := Function[n, Total[l]!/Product[Product[1 + l[[i]] - j + Sum[If[ l[[k]] < j, 0, 1], {k, i + 1, n}], {j, 1, l[[i]]}], {i, 1, n}]][ Length[l]];
    g[n_, i_, l_] := g[n, i, l] = If[n == 0, h[l], If[i < 1, 0, If[i == 1, h[Join[l, Table[1, n]]], g[n, i - 1, l] + If[i > n, 0, g[n - i, i, Append[l, i]]]]]];
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1, k]*Binomial[g[i, k, {}], j], {j, 0, n/i}]]];
    a[n_] := b[n, n, 7];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 06 2018, using code from A293112 *)

Formula

G.f.: Product_{j>=1} (1+x^j)^A007578(j).

A293747 Number of sets of nonempty words with a total of n letters over octonary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 2, 6, 15, 45, 136, 430, 1415, 4844, 17224, 63397, 241968, 953213, 3879822, 16250333, 70050877, 309714232, 1404000641, 6506809837, 30813282963, 148741986670, 731495853897, 3657808596354, 18588011870288, 95841754173073, 501169433939670, 2654344778727646
Offset: 0

Views

Author

Alois P. Heinz, Oct 15 2017

Keywords

Crossrefs

Column k=8 of A293112.

Programs

  • Maple
    g:= proc(n) option remember; `if`(n<4, [1, 1, 2, 4][n+1],
          ((40*n^3+1084*n^2+8684*n+18480)*g(n-1) +16*(n-1)*
          (5*n^3+107*n^2+610*n+600)*g(n-2) -1024*(n-1)*(n-2)*
          (n+6)*g(n-3) -1024*(n-1)*(n-2)*(n-3)*(n+4)*g(n-4))
           /((n+7)*(n+12)*(n+15)*(n+16)))
        end:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(b(n-i*j, i-1)*binomial(g(i), j), j=0..n/i)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..35);
  • Mathematica
    h[l_] := Function[n, Total[l]!/Product[Product[1 + l[[i]] - j + Sum[If[ l[[k]] < j, 0, 1], {k, i + 1, n}], {j, 1, l[[i]]}], {i, 1, n}]][ Length[l]];
    g[n_, i_, l_] := g[n, i, l] = If[n == 0, h[l], If[i < 1, 0, If[i == 1, h[Join[l, Table[1, n]]], g[n, i - 1, l] + If[i > n, 0, g[n - i, i, Append[l, i]]]]]];
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1, k]*Binomial[g[i, k, {}], j], {j, 0, n/i}]]];
    a[n_] := b[n, n, 8];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 06 2018, using code from A293112 *)

Formula

G.f.: Product_{j>=1} (1+x^j)^A007580(j).

A293748 Number of sets of nonempty words with a total of n letters over nonary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 2, 6, 15, 45, 136, 430, 1415, 4845, 17234, 63497, 242720, 958754, 3916799, 16493831, 71586602, 319336319, 1463096806, 6869041635, 33014439494, 162130576595, 812715417240, 4151894763819, 21595739171153, 114222733829429, 613789962584588, 3347502798880170
Offset: 0

Views

Author

Alois P. Heinz, Oct 15 2017

Keywords

Crossrefs

Column k=9 of A293112.

Formula

G.f.: Product_{j>=1} (1+x^j)^A212915(j).

A293742 Number of sets of nonempty words with a total of n letters over ternary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 2, 6, 14, 39, 104, 284, 775, 2145, 5941, 16563, 46329, 130100, 366432, 1035191, 2931797, 8323290, 23680142, 67505721, 192791938, 551537506, 1580315319, 4534715008, 13030197881, 37489497472, 107991978290, 311433926717, 899093131819, 2598257241179
Offset: 0

Views

Author

Alois P. Heinz, Oct 15 2017

Keywords

Crossrefs

Column k=3 of A293112.
Cf. A001006.

Programs

  • Maple
    g:= proc(n) option remember; `if`(n<2, 1,
          g(n-1)+add(g(k)*g(n-k-2), k=0..n-2))
        end:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(b(n-i*j, i-1)*binomial(g(i), j), j=0..n/i)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..35);
  • Mathematica
    With[{n = 29}, CoefficientList[Series[Product[(1 + x^j)^Hypergeometric2F1[(1 - j)/2, -j/2, 2, 4], {j, n}], {x, 0, n}], x]] (* Michael De Vlieger, Oct 15 2017, after Peter Luschny at A001006 *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import binomial
    @cacheit
    def g(n): return 1 if n<2 else g(n - 1) + sum(g(k)*g(n - k - 2) for k in range(n - 1))
    @cacheit
    def b(n, i): return 1 if n==0 else 0 if i<1 else sum(b(n - i*j, i - 1)*binomial(g(i), j) for j in range(n//i + 1))
    def a(n): return b(n, n)
    print([a(n) for n in range(36)]) # Indranil Ghosh, Oct 15 2017

Formula

G.f.: Product_{j>=1} (1+x^j)^A001006(j).
Showing 1-10 of 12 results. Next