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.

A317328 Total number of distinct run lengths summed over all permutations of [n] with exactly k distinct lengths of increasing runs.

Original entry on oeis.org

0, 1, 2, 10, 41, 238, 1560, 11822, 99884, 944951, 9851550, 112297557, 1389182296, 18548151140, 265854443194, 4071965025912, 66379311227650, 1147606112273168, 20974771814051529, 404111977603746584, 8186206878478673819, 173948483818885099616, 3868878742247603336434, 89892706223315981903289
Offset: 0

Views

Author

Alois P. Heinz, Jul 25 2018

Keywords

Crossrefs

Cf. A317327.

Programs

  • Maple
    b:= proc(u, o, t, s) option remember;
          `if`(u+o=0, x^(nops(s union {t})-1),
           add(b(u-j, o+j-1, 1, s union {t}), j=1..u)+
           add(b(u+j-1, o-j, t+1, s), j=1..o))
        end:
    a:= n-> (p-> add(coeff(p, x, i)*i, i=0..degree(p)))(b(n, 0$2, {})):
    seq(a(n), n=0..16);
  • Mathematica
    b[u_, o_, t_, s_] := b[u, o, t, s] =
         If[u + o == 0, x^(Length[s ~Union~ {t}] - 1),
         Sum[b[u - j, o + j - 1, 1, s ~Union~ {t}], {j, 1, u}] +
         Sum[b[u + j - 1, o - j, t + 1, s], {j, 1, o}]];
    a[n_] := Function[p, Sum[Coefficient[p, x, i]*i, {i, 0, Exponent[p, x]}]][
         b[n, 0, 0, {}]];
    Table[a[n], {n, 0, 16}] (* Jean-François Alcover, Apr 15 2022, after Alois P. Heinz *)

Formula

a(n) = Sum_{k=0..floor((sqrt(1+8*n)-1)/2)} k * A317327(n,k).