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.

A268698 Total number of sequences with p_j copies of j and longest increasing subsequence of length k summed over all partitions [p_1, p_2, ..., p_k] of n.

Original entry on oeis.org

1, 1, 2, 4, 13, 36, 157, 554, 2800, 12530, 70772, 362188, 2370564, 13658713, 95366064, 642861687, 4774830263, 34769374156, 288999332899, 2255537559077, 19693313843687, 172690825379198, 1572921138465599, 14538979953843188, 145980379536597239
Offset: 0

Views

Author

Alois P. Heinz, Feb 11 2016

Keywords

Examples

			The partitions of 4 are [1,1,1,1], [2,1,1], [2,2], [3,1], [4] giving the a(4) = 13 sequences: 1234, 1123, 1213, 1231, 1122, 1212, 1221, 2112, 2121, 1112, 1121, 1211, 1111.
		

Crossrefs

Programs

  • Maple
    g:= proc(l) option remember; (n-> f(l[1..nops(l)-1])*
          binomial(n-1, l[-1]-1)+ add(f(sort(subsop(j=l[j]
          -1, l))), j=1..nops(l)-1))(add(i, i=l))
        end:
    f:= l-> (n-> `if`(n<2 or l[-1]=1, 1, `if`(l[1]=0, 0, `if`(
             n=2, binomial(l[1]+l[2], l[1])-1, g(l)))))(nops(l)):
    h:= (n, i, l)-> `if`(n=0 or i=1, f([1$n, l[]]), h(n, i-1, l)+
                    `if`(i>n, 0, h(n-i, i, [i, l[]]))):
    a:= n-> h(n$2, []):
    seq(a(n), n=0..25);
  • Mathematica
    g[l_] := g[l] = Function[n, f[Most[l]]*Binomial[n-1, l[[-1]]-1] + Sum[f[ Sort[ ReplacePart[l, j -> l[[j]]-1]]], {j, 1, Length[l]-1}]][Total[l]]; f[l_] := Function[n, If[n<2 || l[[-1]] == 1, 1, If[l[[1]] == 0, 0, If[n == 2, Binomial[l[[1]] + l[[2]], l[[1]]]-1, g[l]]]]][Length[l]]; h[n_, i_, l_] := h[n, i, l] = If[n == 0 || i == 1, f[Join[Array[1&, n], l]], h[n, i - 1, l] + If[i>n, 0, h[n-i, i, Prepend[l, i]]]]; a[n_] := h[n, n, {}]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 02 2017, translated from Maple *)

A268700 Total number of sequences with p_j copies of j and longest increasing subsequence of length k summed over all partitions [p_1, p_2, ..., p_k] of n into distinct parts.

Original entry on oeis.org

1, 1, 1, 3, 4, 14, 46, 111, 330, 1614, 7348, 21340, 98145, 379405, 2633085, 14871033, 57284558, 278927415, 1609313975, 8289565670, 74945364815, 522977754235, 2403799401259, 14180489136597, 83964652635668, 623008803758260, 3918144764978718, 46950727351392315
Offset: 0

Views

Author

Alois P. Heinz, Feb 11 2016

Keywords

Examples

			The partitions of 4 into distinct parts are [3,1], [4] giving the a(4) = 4 sequences: 1112, 1121, 1211, 1111.
		

Crossrefs

Programs

  • Maple
    g:= proc(l) option remember; (n-> f(l[1..nops(l)-1])*
          binomial(n-1, l[-1]-1)+ add(f(sort(subsop(j=l[j]
          -1, l))), j=1..nops(l)-1))(add(i, i=l))
        end:
    f:= l-> (n-> `if`(n<2 or l[-1]=1, 1, `if`(l[1]=0, 0, `if`(
             n=2, binomial(l[1]+l[2], l[1])-1, g(l)))))(nops(l)):
    h:= (n, i, l)-> `if`(n>i*(i+1)/2, 0, `if`(n=0, f(l), h(n, i-1, l)
                   +`if`(i>n, 0, h(n-i, i-1, [i, l[]])))):
    a:= n-> h(n$2, []):
    seq(a(n), n=0..30);
  • Mathematica
    g[l_] := g[l] = Function[n, f[Most[l]]*Binomial[n-1, l[[-1]]-1] + Sum[f[ Sort[ReplacePart[l, j -> l[[j]]-1]]], {j, 1, Length[l]-1}]][Total[l]]; f[l_] := Function[n, If[n<2 || l[[-1]]==1, 1, If[l[[1]]==0, 0, If[n==2, Binomial[l[[1]]+l[[2]], l[[1]]]-1, g[l]]]]][Length[l]]; h[n_, i_, l_] := If[n>i*(i+1)/2, 0, If[n==0, f[l], h[n, i-1, l] + If[i>n, 0, h[n-i, i-1, Join[{i}, l]]]]]; a[n_] := h[n, n, {}]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Feb 11 2017, translated from Maple *)

A268701 Total number of sequences with c_j copies of j and longest increasing subsequence of length k summed over all compositions [c_1, c_2, ..., c_k] of n into distinct parts.

Original entry on oeis.org

1, 1, 1, 5, 7, 27, 195, 421, 1619, 8675, 105757, 274029, 1402193, 6625987, 55349787, 975068069, 3137395939, 17960895375, 101880880461, 696011551909, 7596647200175, 197122787505191, 723879298052695, 4905597865756059, 29537689035766501, 227793692735075911
Offset: 0

Views

Author

Alois P. Heinz, Feb 11 2016

Keywords

Examples

			The compositions of 4 into distinct parts are [3,1], [1,3], [4] giving the a(4) = 7 sequences: 1112, 1121, 1211, 1222, 2122, 2212, 1111.
		

Crossrefs

Programs

  • Maple
    c:= l-> f(l)*nops(l)!/(v-> mul(coeff(v, x, j)!,
            j=0..degree(v)))(add(x^i, i=l)):
    g:= proc(l) option remember; (n-> f(l[1..nops(l)-1])*
          binomial(n-1, l[-1]-1)+ add(f(sort(subsop(j=l[j]
          -1, l))), j=1..nops(l)-1))(add(i, i=l))
        end:
    f:= l-> (n-> `if`(n<2 or l[-1]=1, 1, `if`(l[1]=0, 0, `if`(
             n=2, binomial(l[1]+l[2], l[1])-1, g(l)))))(nops(l)):
    h:= (n, i, l)-> `if`(n>i*(i+1)/2, 0, `if`(n=0, c(l), h(n, i-1, l)
                   +`if`(i>n, 0, h(n-i, i-1, [i, l[]])))):
    a:= n-> h(n$2, []):
    seq(a(n), n=0..30);
  • Mathematica
    c[l_] := f[l]*Length[l]!/Function[v, Product[Coefficient[v, x, j]!,{j, 0, Exponent[v, x]}]][Sum[x^i, {i, l}]];
    g[l_] := g[l] = Function[n, f[Most[l]]*Binomial[n - 1, l[[-1]] - 1] + Sum[f[Sort[ReplacePart[l, j -> l[[j]] - 1]]], {j, 1, Length[l] - 1}]][Total[l]];
    f[l_] := Function[n, If[n < 2 || l[[-1]] == 1, 1, If[l[[1]] == 0, 0, If[n == 2, Binomial[l[[1]] + l[[2]], l[[1]]] - 1, g[l]]]]][Length[l]];
    h[n_, i_, l_] := If[n > i (i + 1)/2, 0, If[n == 0, c[l], h[n, i - 1, l] + If[i > n, 0, h[n - i, i - 1, Join[{i}, l]]]]];
    a[n_] := h[n, n, {}];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jul 12 2021, after Alois P. Heinz *)
Showing 1-3 of 3 results.