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.

A329766 Number of compositions of n whose run-lengths cover an initial interval of positive integers.

Original entry on oeis.org

1, 1, 1, 3, 6, 13, 21, 48, 89, 180, 355, 707, 1382, 2758, 5448, 10786, 21391, 42476, 84291, 167516, 333036, 662153, 1317687, 2622706, 5221951, 10400350, 20720877, 41288823, 82294979, 164052035, 327088649, 652238016, 1300788712, 2594486045, 5175378128, 10324522020
Offset: 0

Views

Author

Gus Wiseman, Nov 20 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers with sum n.

Examples

			The a(0) = 1 through a(5) = 13 compositions:
  ()  (1)  (2)  (3)    (4)      (5)
                (1,2)  (1,3)    (1,4)
                (2,1)  (3,1)    (2,3)
                       (1,1,2)  (3,2)
                       (1,2,1)  (4,1)
                       (2,1,1)  (1,1,3)
                                (1,2,2)
                                (1,3,1)
                                (2,1,2)
                                (2,2,1)
                                (3,1,1)
                                (1,1,2,1)
                                (1,2,1,1)
		

Crossrefs

Looking at multiplicities instead of run-lengths gives A329741.
The complete case is A329749.
Complete compositions are A107429.

Programs

  • Mathematica
    normQ[m_]:=Or[m=={},Union[m]==Range[Max[m]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],normQ[Length/@Split[#]]&]],{n,0,10}]

Extensions

a(21)-a(26) from Giovanni Resta, Nov 22 2019
a(27)-a(35) from Alois P. Heinz, Jul 06 2020

A329748 Number of complete compositions of n whose multiplicities cover an initial interval of positive integers.

Original entry on oeis.org

1, 1, 0, 2, 3, 3, 6, 12, 12, 42, 114, 210, 60, 360, 720, 1320, 1590, 3690, 6450, 16110, 33120, 59940, 61320, 112980, 171780, 387240, 803880, 769440, 1773240, 2823240, 5790960, 9916200, 19502280, 28244160, 56881440, 130548600, 279578880, 320554080, 541323720
Offset: 0

Views

Author

Gus Wiseman, Nov 21 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers with sum n. It is complete if it covers an initial interval of positive integers.

Examples

			The a(1) = 1 through a(8) = 12 compositions (empty column not shown):
  (1)  (12)  (112)  (122)  (123)  (1123)  (1223)
       (21)  (121)  (212)  (132)  (1132)  (1232)
             (211)  (221)  (213)  (1213)  (1322)
                           (231)  (1231)  (2123)
                           (312)  (1312)  (2132)
                           (321)  (1321)  (2213)
                                  (2113)  (2231)
                                  (2131)  (2312)
                                  (2311)  (2321)
                                  (3112)  (3122)
                                  (3121)  (3212)
                                  (3211)  (3221)
		

Crossrefs

Looking at run-lengths instead of multiplicities gives A329749.
The non-complete version is A329741.
Complete compositions are A107429.

Programs

  • Mathematica
    normQ[m_]:=Or[m=={},Union[m]==Range[Max[m]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],normQ[#]&&normQ[Length/@Split[Sort[#]]]&]],{n,0,10}]

Extensions

a(21)-a(38) from Alois P. Heinz, Jul 06 2020

A335443 Number of compositions of n where neighboring runs have different lengths.

Original entry on oeis.org

1, 1, 2, 2, 5, 8, 13, 24, 42, 68, 122, 210, 360, 622, 1077, 1858, 3198, 5519, 9549, 16460, 28386, 49031, 84595, 145988, 251956, 434805, 750418, 1294998, 2234971, 3857106, 6656383, 11487641, 19825318, 34214136, 59046458, 101901743, 175860875, 303498779
Offset: 0

Views

Author

Alois P. Heinz, Jul 06 2020

Keywords

Examples

			a(0) = 1: the empty composition.
a(1) = 1: 1.
a(2) = 2: 2, 11.
a(3) = 2: 3, 111.
a(4) = 5: 4, 22, 112, 211, 1111.
a(5) = 8: 5, 113, 122, 221, 311, 1112, 2111, 11111.
a(6) = 13: 6, 33, 114, 222, 411, 1113, 1221, 2112, 3111, 11112, 11211, 21111, 111111.
a(7) = 24: 7, 115, 133, 223, 322, 331, 511, 1114, 1222, 2113, 2221, 3112, 4111, 11113, 11122, 11311, 21112, 22111, 31111, 111112, 111211, 112111, 211111, 1111111.
a(8) = 42: 8, 44, 116, 224, 233, 332, 422, 611, 1115, 1223, 1331, 2114, 2222, 3113, 3221, 4112, 5111, 11114, 11222, 11411, 12221, 21113, 22211, 31112, 41111, 111113, 111122, 111221, 111311, 112112, 113111, 122111, 211112, 211211, 221111, 311111, 1111112, 1111211, 1112111, 1121111, 2111111, 11111111.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, l, t) option remember; `if`(n=0, 1, add(add(
          `if`(j=t, 0, b(n-i*j, i, j)), j=1..n/i), i={$1..n} minus {l}))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, l_, t_] := b[n, l, t] = If[n == 0, 1, Sum[Sum[If[j == t, 0,
         b[n-i*j, i, j]], {j, 1, n/i}], {i, Range[n]~Complement~{l}}]];
    a[n_] := b[n, 0, 0];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Apr 13 2022, after Alois P. Heinz *)
Showing 1-3 of 3 results.