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-2 of 2 results.

A224960 Number of compositions [p(1), p(2), ..., p(k)] of n such that p(j) >= p(1) - 1.

Original entry on oeis.org

1, 1, 2, 4, 7, 14, 26, 52, 101, 200, 396, 787, 1564, 3117, 6214, 12398, 24749, 49427, 98740, 197303, 394323, 788201, 1575695, 3150265, 6298732, 12594595, 25184598, 50361842, 100711888, 201404839, 402779246, 805509560, 1610940381, 3221753990
Offset: 0

Views

Author

Joerg Arndt, Apr 21 2013

Keywords

Examples

			The a(5) = 14 such compositions of 5 are
01:  [ 1 1 1 1 1 ]
02:  [ 1 1 1 2 ]
03:  [ 1 1 2 1 ]
04:  [ 1 1 3 ]
05:  [ 1 2 1 1 ]
06:  [ 1 2 2 ]
07:  [ 1 3 1 ]
08:  [ 1 4 ]
09:  [ 2 1 1 1 ]
10:  [ 2 1 2 ]
11:  [ 2 2 1 ]
12:  [ 2 3 ]
13:  [ 3 2 ]
14:  [ 5 ]
(the two forbidden compositions are [ 3 1 1 ] and [ 4 1 ]).
		

Crossrefs

Cf. A171682 (compositions such that p(j) >= p(1)).
Cf. A079501 (compositions such that p(j) > p(1)).
Cf. A048888 (compositions such that p(j) <= p(1) + 1).
Cf. A007059 (compositions such that p(j) < p(1)).
Cf. A079500 (compositions such that p(j) <= p(1)).

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j,
          `if`(i=0, max(1, j-1), i)), j=`if`(i=0, 1, i)..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, May 02 2013
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n - j, If[i == 0, Max[1, j - 1], i]], {j, If[i == 0, 1, i], n}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 50] (* Jean-François Alcover, Dec 20 2020, after Alois P. Heinz *)

Formula

a(n) ~ 3 * 2^(n-3). - Vaclav Kotesovec, May 01 2014

A238347 Triangle T(n,k) read by rows: T(n,k) is the number of compositions of n where the k-th part is the first occurrence of a smallest part, n>=1, 1<=k<=n.

Original entry on oeis.org

1, 2, 0, 3, 1, 0, 6, 2, 0, 0, 10, 5, 1, 0, 0, 20, 9, 3, 0, 0, 0, 37, 19, 7, 1, 0, 0, 0, 72, 36, 16, 4, 0, 0, 0, 0, 140, 71, 33, 11, 1, 0, 0, 0, 0, 275, 139, 67, 26, 5, 0, 0, 0, 0, 0, 540, 274, 135, 58, 16, 1, 0, 0, 0, 0, 0, 1069, 539, 269, 123, 42, 6, 0, 0, 0, 0, 0, 0, 2118, 1068, 534, 254, 99, 22, 1, 0
Offset: 1

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 25 2014

Keywords

Comments

Column k=0 is A238351. Column k=1 is A171682.
Row sums are A011782.

Examples

			Triangle starts:
01:  1,
02:  2, 0,
03:  3, 1, 0,
04:  6, 2, 0, 0,
05:  10, 5, 1, 0, 0,
06:  20, 9, 3, 0, 0, 0,
07:  37, 19, 7, 1, 0, 0, 0,
08:  72, 36, 16, 4, 0, 0, 0, 0,
09:  140, 71, 33, 11, 1, 0, 0, 0, 0,
10:  275, 139, 67, 26, 5, 0, 0, 0, 0, 0,
11:  540, 274, 135, 58, 16, 1, 0, 0, 0, 0, 0,
12:  1069, 539, 269, 123, 42, 6, 0, 0, 0, 0, 0, 0,
13:  2118, 1068, 534, 254, 99, 22, 1, 0, 0, 0, 0, 0, 0,
14:  4206, 2117, 1062, 516, 220, 64, 7, 0, 0, 0, 0, 0, 0, 0,
15:  8365, 4205, 2111, 1040, 470, 163, 29, 1, 0, 0, 0, 0, 0, 0, 0,
...
		
Showing 1-2 of 2 results.