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.

A320265 Number of proper multisets of nonempty words with a total of n letters over n-ary alphabet such that if a letter occurs in the multiset all predecessors occur at least once.

Original entry on oeis.org

1, 3, 23, 178, 1786, 20927, 282520, 4299263, 72750927, 1353700567, 27452623890, 602326265519, 14209892886819, 358576428141962, 9634718410829852, 274567642777650028, 8270000441627265937, 262464788618069324640, 8752908129221863491691, 305968679117675345995513
Offset: 2

Views

Author

Alois P. Heinz, Oct 08 2018

Keywords

Examples

			a(2) = 1: {a,a}.
a(3) = 3: {a,a,a}, {a,a,b}, {a,b,b}.
a(4) = 23: {a,a,a,a}, {a,a,aa}, {aa, aa}, {a,a,a,b}, {a,a,b,b}, {a,b,b,b}, {a,a,ab}, {a,a,ba}, {a,a,bb}, {b,b,ab}, {b,b,ba}, {b,b,aa}, {ab,ab}, {ba,ba}, {a,a,b,c}, {a,a,bc}, {a,a,cb}, {b,b,a,c}, {b,b,ac}, {b,b,ca}, {c,c,a,b}, {c,c,ab}, {c,c,ba}.
		

Crossrefs

Row sums of A320264.

Programs

  • Maple
    h:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(h(n-i*j, i-1, k)*binomial(k^i, j), j=0..n/i)))
        end:
    g:= proc(n, k) option remember; `if`(n=0, 1, add(add(
          d*k^d, d=numtheory[divisors](j))*g(n-j, k), j=1..n)/n)
        end:
    a:= n-> add(add((-1)^i*(g(n, k-i)-h(n$2, k-i))*
            binomial(k, i), i=0..k), k=1..n-1):
    seq(a(n), n=2..25);
  • Mathematica
    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[k^i, j], {j, 0, n/i}]]];
    g[n_, k_] := g[n, k] = If[n == 0, 1, Sum[Sum[d*k^d, {d, Divisors[j]}]*g[n - j, k], {j, 1, n}]/n];
    T[n_, k_] := Sum[(-1)^i*(g[n, k-i]-h[n, n, k-i])*Binomial[k, i], {i, 0, k}];
    a[n_] := Sum[T[n, k], {k, 1, n - 1}];
    Table[a[n], {n, 2, 25}] (* Jean-François Alcover, Jun 01 2022, after Alois P. Heinz in A320264 *)

Formula

a(n) = Sum_{k=1..n-1} A320264(n,k).
a(n) = A257741(n) - A319518(n).