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.

A072704 Triangle of number of weakly unimodal partitions/compositions of n into exactly k terms.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 5, 4, 1, 1, 5, 8, 7, 5, 1, 1, 6, 12, 12, 9, 6, 1, 1, 7, 16, 20, 16, 11, 7, 1, 1, 8, 21, 30, 28, 20, 13, 8, 1, 1, 9, 27, 42, 45, 36, 24, 15, 9, 1, 1, 10, 33, 58, 68, 60, 44, 28, 17, 10, 1, 1, 11, 40, 77, 98, 95, 75, 52, 32, 19, 11, 1
Offset: 1

Views

Author

Henry Bottomley, Jul 04 2002

Keywords

Examples

			Rows start:
01:  [1]
02:  [1, 1]
03:  [1, 2, 1]
04:  [1, 3, 3, 1]
05:  [1, 4, 5, 4, 1]
06:  [1, 5, 8, 7, 5, 1]
07:  [1, 6, 12, 12, 9, 6, 1]
08:  [1, 7, 16, 20, 16, 11, 7, 1]
09:  [1, 8, 21, 30, 28, 20, 13, 8, 1]
10:  [1, 9, 27, 42, 45, 36, 24, 15, 9, 1]
...
T(6,3)=8 since 6 can be written as 1+1+4, 1+2+3, 1+3+2, 1+4+1, 2+2+2, 2+3+1, 3+2+1, or 4+1+1 but not 2+1+3 or 3+1+2.
		

Crossrefs

Cf. A059623, A072705. Row sums are A001523. First column is A057427, second is A000027 offset, third appears to be A000212 offset, right hand columns include A000012, A000027, A005408 and A008574.
The case of partitions is A072233.
Dominates A332670 (the version for negated compositions).
The strict case is A072705.
The case of constant compositions is A113704.
Unimodal sequences covering an initial interval are A007052.
Partitions whose run-lengths are unimodal are A332280.

Programs

  • Maple
    b:= proc(n, i) option remember; local q; `if`(i>n, 0,
          `if`(irem(n, i, 'q')=0, x^q, 0) +expand(
          add(b(n-i*j, i+1)*(j+1)*x^j, j=0..n/i)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n, 1)):
    seq(T(n), n=1..12);  # Alois P. Heinz, Mar 26 2014
  • Mathematica
    b[n_, i_] := b[n, i] = If[i>n, 0, If[Mod[n, i ] == 0, x^Quotient[n, i], 0] + Expand[ Sum[b[n-i*j, i+1]*(j+1)*x^j, {j, 0, n/i}]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 1, n}]][b[n, 1]]; Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Feb 26 2015, after Alois P. Heinz *)
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],unimodQ]],{n,0,10},{k,0,n}] (* Gus Wiseman, Mar 06 2020 *)
  • PARI
    \\ starting for n=0, with initial column 1, 0, 0, ...:
    N=25;  x='x+O('x^N);
    T=Vec(1 + sum(n=1, N, t*x^n / ( prod(k=1,n-1, (1 - t*x^k)^2 ) * (1 - t*x^n) ) ) )
    for(r=1,#T, print(Vecrev(T[r])) ); \\ Joerg Arndt, Oct 01 2017

Formula

G.f. with initial column 1, 0, 0, ...: 1 + Sum_{n>=1} (t*x^n / ( ( Product_{k=1..n-1} (1 - t*x^k)^2 ) * (1 - t*x^n) ) ). - Joerg Arndt, Oct 01 2017