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

A115981 The number of compositions of n which cannot be viewed as stacks.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 5, 17, 49, 126, 303, 694, 1536, 3312, 7009, 14619, 30164, 61732, 125568, 254246, 513048, 1032696, 2074875, 4163256, 8345605, 16717996, 33473334, 66998380, 134067959, 268233386, 536599508, 1073378850, 2147000209
Offset: 0

Views

Author

Alford Arnold, Feb 12 2006

Keywords

Comments

A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence. A composition of n is a finite sequence of positive integers summing to n. - Gus Wiseman, Mar 05 2020

Examples

			a(5) = 1 counting {212}.
a(6) = 5 counting {1212, 2112,2121,213,312}.
a(7) = 17 counting {11212, 12112,12121, 21211, 21121, 21112, 2122, 2212, 2113, 3112, 2131, 3121, 1213, 1312, 412, 214, 313}.
a(8) = 49 = 128 - 79.
a(9) = 126 = 256 - 130.
		

Crossrefs

The complement is counted by A001523.
The strict case is A072707.
The case covering an initial interval is A332743.
The version whose negation is not unimodal either is A332870.
Non-unimodal permutations are A059204.
Non-unimodal normal sequences are A328509.
Partitions with non-unimodal run-lengths are A332281.
Numbers whose prime signature is not unimodal are A332282.
Partitions whose 0-appended first differences are not unimodal are A332284.
Non-unimodal permutations of the prime indices of n are A332671.

Programs

  • Mathematica
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!unimodQ[#]&]],{n,0,10}] (* Gus Wiseman, Mar 05 2020 *)

Formula

a(n) = A011782(n) - A001523(n).

Extensions

More terms from Brian Kuehn (brk158(AT)psu.edu), Apr 20 2006
a(25) corrected by Georg Fischer, Jun 29 2021

A072706 Number of unimodal partitions/compositions of n into distinct terms.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 9, 11, 15, 21, 33, 39, 55, 69, 93, 127, 159, 201, 261, 327, 411, 537, 653, 819, 1011, 1257, 1529, 1899, 2331, 2829, 3441, 4179, 5031, 6093, 7305, 8767, 10575, 12573, 14997, 17847, 21223, 25089, 29757, 35055, 41379, 48801, 57285, 67131
Offset: 0

Views

Author

Henry Bottomley, Jul 04 2002

Keywords

Comments

Also the number of ways to partition a strict integer partition of n into two unordered blocks. - Gus Wiseman, Dec 31 2019

Examples

			a(6)=9 since 6 can be written as 1+2+3, 1+3+2, 1+5, 2+3+1, 2+4, 3+2+1, 4+2, 5+1, or 6, but not for example 1+4+1 (which does not have distinct terms) nor 2+1+3 (which is not unimodal).
From _Joerg Arndt_, Mar 25 2014: (Start)
The a(10) = 33 such compositions of 10 are:
01:  [ 1 2 3 4 ]
02:  [ 1 2 4 3 ]
03:  [ 1 2 7 ]
04:  [ 1 3 4 2 ]
05:  [ 1 3 6 ]
06:  [ 1 4 3 2 ]
07:  [ 1 4 5 ]
08:  [ 1 5 4 ]
09:  [ 1 6 3 ]
10:  [ 1 7 2 ]
11:  [ 1 9 ]
12:  [ 2 3 4 1 ]
13:  [ 2 3 5 ]
14:  [ 2 4 3 1 ]
15:  [ 2 5 3 ]
16:  [ 2 7 1 ]
17:  [ 2 8 ]
18:  [ 3 4 2 1 ]
19:  [ 3 5 2 ]
20:  [ 3 6 1 ]
21:  [ 3 7 ]
22:  [ 4 3 2 1 ]
23:  [ 4 5 1 ]
24:  [ 4 6 ]
25:  [ 5 3 2 ]
26:  [ 5 4 1 ]
27:  [ 6 3 1 ]
28:  [ 6 4 ]
29:  [ 7 2 1 ]
30:  [ 7 3 ]
31:  [ 8 2 ]
32:  [ 9 1 ]
33:  [ 10 ]
(End)
		

Crossrefs

The non-strict version is A001523.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0, `if`(n=0, 1,
          expand(b(n, i-1) +`if`(i>n, 0, x*b(n-i, i-1)))))
        end:
    a:= n->(p->add(coeff(p, x, i)*ceil(2^(i-1)), i=0..degree(p)))(b(n$2)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 25 2014
  • Mathematica
    b[n_, i_] := b[n, i] = If[n > i*(i + 1)/2, 0, If[n == 0, 1, Expand[b[n, i - 1] + If[i > n, 0, x*b[n - i, i - 1]]]]]; a[n_] := Function[{p}, Sum[Coefficient[p, x, i]*Ceiling[2^(i - 1)], {i, 0, Exponent[p, x]}]][b[n, n]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jan 16 2015, after Alois P. Heinz *)
    Table[If[n==0,1,Sum[2^(Length[ptn]-1),{ptn,Select[IntegerPartitions[n],UnsameQ@@#&]}]],{n,0,15}] (* Gus Wiseman, Dec 31 2019 *)
  • PARI
    N=66; q='q+O('q^N); Vec( 1 + sum(n=1, N, 2^(n-1)*q^(n*(n+1)/2) / prod(k=1, n, 1-q^k ) ) ) \\ Joerg Arndt, Mar 25 2014

Formula

a(n) = sum_k A072705(n, k) = A032020(n)-A072707(k) = A032302(n)/2 (n>0).
G.f.: 1/2*(1+Product_{k>0} (1+2*x^k)). - Vladeta Jovovic, Jun 24 2003
G.f.: 1 + sum(n>=1, 2^(n-1)*q^(n*(n+1)/2) / prod(k=1..n, 1-q^k ) ). [Joerg Arndt, Jan 20 2014]
a(n) ~ c^(1/4) * exp(2*sqrt(c*n)) / (4*sqrt(3*Pi)*n^(3/4)), where c = -polylog(2, -2) = A266576 = 1.436746366883680946362902023893583354... - Vaclav Kotesovec, Sep 22 2019

A332669 Number of compositions of n whose negation is not unimodal.

Original entry on oeis.org

0, 0, 0, 0, 1, 3, 11, 28, 71, 165, 372, 807, 1725, 3611, 7481, 15345, 31274, 63392, 128040, 257865, 518318, 1040277, 2085714, 4178596, 8367205, 16748151, 33515214, 67056139, 134147231, 268341515, 536746350, 1073577185, 2147266984, 4294683056, 8589563136, 17179385180
Offset: 0

Views

Author

Gus Wiseman, Feb 28 2020

Keywords

Comments

A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.
A composition of n is a finite sequence of positive integers summing to n.

Examples

			The a(4) = 1 through a(6) = 11 compositions:
  (121)  (131)   (132)
         (1121)  (141)
         (1211)  (231)
                 (1131)
                 (1212)
                 (1221)
                 (1311)
                 (2121)
                 (11121)
                 (11211)
                 (12111)
		

Crossrefs

The strict case is A072707.
The complement is counted by A332578.
The version for run-lengths of partitions is A332639.
The version for unsorted prime signature is A332642.
The version for 0-appended first-differences of partitions is A332744.
The case that is not unimodal either is A332870.
Unimodal compositions are A001523.
Non-unimodal permutations are A059204.
Non-unimodal compositions are A115981.
Non-unimodal normal sequences are A328509.
Numbers whose unsorted prime signature is not unimodal are A332282.
A triangle for compositions with unimodal negation is A332670.

Programs

  • Mathematica
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!unimodQ[-#]&]],{n,0,10}]

Formula

a(n) + A332578(n) = 2^(n - 1) for n > 0.

Extensions

Terms a(21) and beyond from Andrew Howroyd, Mar 01 2020

A333147 Number of compositions of n that are either strictly increasing or strictly decreasing.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 7, 9, 11, 15, 19, 23, 29, 35, 43, 53, 63, 75, 91, 107, 127, 151, 177, 207, 243, 283, 329, 383, 443, 511, 591, 679, 779, 895, 1023, 1169, 1335, 1519, 1727, 1963, 2225, 2519, 2851, 3219, 3631, 4095, 4607, 5179, 5819, 6527, 7315, 8193, 9163
Offset: 0

Views

Author

Gus Wiseman, May 16 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.

Examples

			The a(1) = 1 through a(9) = 15 compositions:
  (1)  (2)  (3)    (4)    (5)    (6)      (7)      (8)      (9)
            (1,2)  (1,3)  (1,4)  (1,5)    (1,6)    (1,7)    (1,8)
            (2,1)  (3,1)  (2,3)  (2,4)    (2,5)    (2,6)    (2,7)
                          (3,2)  (4,2)    (3,4)    (3,5)    (3,6)
                          (4,1)  (5,1)    (4,3)    (5,3)    (4,5)
                                 (1,2,3)  (5,2)    (6,2)    (5,4)
                                 (3,2,1)  (6,1)    (7,1)    (6,3)
                                          (1,2,4)  (1,2,5)  (7,2)
                                          (4,2,1)  (1,3,4)  (8,1)
                                                   (4,3,1)  (1,2,6)
                                                   (5,2,1)  (1,3,5)
                                                            (2,3,4)
                                                            (4,3,2)
                                                            (5,3,1)
                                                            (6,2,1)
		

Crossrefs

Strict partitions are A000009.
Unimodal compositions are A001523 (strict: A072706).
Strict compositions are A032020.
The non-strict version appears to be A329398.
Partitions with incr. or decr. run-lengths are A332745 (strict: A333190).
Compositions with incr. or decr. run-lengths are A332835 (strict: A333191).
The complement is counted by A333149 (non-strict: A332834).

Programs

  • Mathematica
    Table[2*PartitionsQ[n]-1,{n,0,30}]

Formula

a(n) = 2*A000009(n) - 1.

A072705 Triangle of number of unimodal compositions of n into exactly k distinct terms.

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 1, 2, 0, 0, 1, 4, 0, 0, 0, 1, 4, 4, 0, 0, 0, 1, 6, 4, 0, 0, 0, 0, 1, 6, 8, 0, 0, 0, 0, 0, 1, 8, 12, 0, 0, 0, 0, 0, 0, 1, 8, 16, 8, 0, 0, 0, 0, 0, 0, 1, 10, 20, 8, 0, 0, 0, 0, 0, 0, 0, 1, 10, 28, 16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 32, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Henry Bottomley, Jul 04 2002

Keywords

Comments

Also the number of compositions of n into exactly k distinct terms whose negation is unimodal. - Gus Wiseman, Mar 06 2020

Examples

			Rows start: 1; 1,0; 1,2,0; 1,2,0,0; 1,4,0,0,0; 1,4,4,0,0,0; 1,6,4,0,0,0,0; 1,6,8,0,0,0,0,0; etc. T(6,3)=4 since 6 can be written as 1+2+3, 1+3+2, 2+3+1, or 3+2+1 but not 2+1+3 or 3+1+2.
From _Gus Wiseman_, Mar 06 2020: (Start)
Triangle begins:
  1
  1  0
  1  2  0
  1  2  0  0
  1  4  0  0  0
  1  4  4  0  0  0
  1  6  4  0  0  0  0
  1  6  8  0  0  0  0  0
  1  8 12  0  0  0  0  0  0
  1  8 16  8  0  0  0  0  0  0
  1 10 20  8  0  0  0  0  0  0  0
  1 10 28 16  0  0  0  0  0  0  0  0
  1 12 32 24  0  0  0  0  0  0  0  0  0
  1 12 40 40  0  0  0  0  0  0  0  0  0  0
  1 14 48 48 16  0  0  0  0  0  0  0  0  0  0
(End)
		

Crossrefs

Cf. A060016, A072574, A072704. Row sums are A072706.
Column k = 2 is A052928.
Unimodal compositions are A001523.
Unimodal sequences covering an initial interval are A007052.
Strict compositions are A032020.
Non-unimodal strict compositions are A072707.
Unimodal compositions covering an initial interval are A227038.
Numbers whose prime signature is not unimodal are A332282.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0, `if`(n=0, 1,
          expand(b(n, i-1) +`if`(i>n, 0, x*b(n-i, i-1)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i)*ceil(2^(i-1)), i=1..n))(b(n$2)):
    seq(T(n), n=1..14);  # Alois P. Heinz, Mar 26 2014
  • Mathematica
    b[n_, i_] := b[n, i] = If[n > i*(i+1)/2, 0, If[n == 0, 1, Expand[b[n, i-1] + If[i > n, 0, x*b[n-i, i-1]]]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i]* Ceiling[2^(i-1)], {i, 1, n}]][b[n, n]]; Table[T[n], {n, 1, 14}] // 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}],UnsameQ@@#&&unimodQ[#]&]],{n,12},{k,n}] (* Gus Wiseman, Mar 06 2020 *)

Formula

T(n,k) = 2^(k-1)*A060016(n,k) = T(n-k,k)+2*T(n-k,k-1) [starting with T(0,0)=0, T(0,1)=0 and T(n,1)=1 for n>0].

A333149 Number of strict compositions of n that are neither increasing nor decreasing.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 4, 4, 8, 12, 38, 42, 72, 98, 150, 298, 372, 542, 760, 1070, 1428, 2600, 3120, 4550, 6050, 8478, 10976, 15220, 23872, 29950, 41276, 55062, 74096, 97148, 129786, 167256, 256070, 314454, 429338, 556364, 749266, 955746, 1275016, 1618054
Offset: 0

Views

Author

Gus Wiseman, May 16 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. It is strict if there are no repeated parts.

Examples

			The a(6) = 4 through a(9) = 12 compositions:
  (1,3,2)  (1,4,2)  (1,4,3)  (1,5,3)
  (2,1,3)  (2,1,4)  (1,5,2)  (1,6,2)
  (2,3,1)  (2,4,1)  (2,1,5)  (2,1,6)
  (3,1,2)  (4,1,2)  (2,5,1)  (2,4,3)
                    (3,1,4)  (2,6,1)
                    (3,4,1)  (3,1,5)
                    (4,1,3)  (3,2,4)
                    (5,1,2)  (3,4,2)
                             (3,5,1)
                             (4,2,3)
                             (5,1,3)
                             (6,1,2)
		

Crossrefs

The non-strict case is A332834.
The complement is counted by A333147.
Strict partitions are A000009.
Strict compositions are A032020.
Non-unimodal strict compositions are A072707.
Strict partitions with increasing or decreasing run-lengths are A333190.
Strict compositions with increasing or decreasing run-lengths are A333191.
Unimodal compositions are A001523, with strict case A072706.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@#&&!Greater@@#&&!Less@@#&]],{n,0,10}]

Formula

a(n) = A032020(n) - 2*A000009(n) + 1.

A333193 Number of compositions of n whose non-adjacent parts are strictly decreasing.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 21, 29, 40, 53, 71, 93, 122, 158, 204, 260, 332, 419, 528, 661, 825, 1023, 1267, 1560, 1916, 2344, 2860, 3476, 4217, 5097, 6147, 7393, 8872, 10618, 12685, 15115, 17977, 21336, 25276, 29882, 35271, 41551, 48872, 57385, 67277, 78745, 92040
Offset: 0

Views

Author

Gus Wiseman, May 18 2020

Keywords

Examples

			The a(1) = 1 through a(7) = 15 compositions:
  (1)  (2)   (3)   (4)    (5)    (6)     (7)
       (11)  (12)  (13)   (14)   (15)    (16)
             (21)  (22)   (23)   (24)    (25)
                   (31)   (32)   (33)    (34)
                   (211)  (41)   (42)    (43)
                          (221)  (51)    (52)
                          (311)  (231)   (61)
                                 (312)   (241)
                                 (321)   (322)
                                 (411)   (331)
                                 (2211)  (412)
                                         (421)
                                         (511)
                                         (2311)
                                         (3211)
For example, (2,3,1,2) is not such a composition, because the non-adjacent pairs of parts are (2,1), (2,2), (3,2), not all of which are strictly decreasing, while (2,4,1,1) is such a composition, because the non-adjacent pairs of parts are (2,1), (2,1), (4,1), all of which are strictly decreasing.
		

Crossrefs

A version for ordered set partitions is A332872.
The case of strict compositions is A333150.
The case of normal sequences appears to be A001045.
Unimodal compositions are A001523, with strict case A072706.
Strict compositions are A032020.
Partitions with strictly increasing run-lengths are A100471.
Partitions with strictly decreasing run-lengths are A100881.
Compositions with weakly decreasing non-adjacent parts are A333148.
Compositions with strictly increasing run-lengths are A333192.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,,y_,_}/;y>=x]&]],{n,0,15}]
  • PARI
    \\ p is all, q is those ending in an unreversed singleton.
    seq(n)={my(q=O(x*x^n), p=1+q); for(k=1, n, [p,q] = [p*(1 + x^k + x^(2*k)) + q*x^k, q + p*x^k] ); Vec(p)} \\ Andrew Howroyd, Apr 17 2021

Extensions

Terms a(21) and beyond from Andrew Howroyd, Apr 17 2021

A334966 Numbers k such that the k-th composition in standard order (row k of A066099) has weakly decreasing non-adjacent parts.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 47, 48, 49, 51, 55, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 85, 86, 87
Offset: 1

Views

Author

Gus Wiseman, May 18 2020

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The complement starts: 14, 26, 28, 29, 30, 44, 46, 50, ...

Examples

			The sequence together with the corresponding compositions begins:
   0: ()           17: (4,1)          37: (3,2,1)
   1: (1)          18: (3,2)          38: (3,1,2)
   2: (2)          19: (3,1,1)        39: (3,1,1,1)
   3: (1,1)        20: (2,3)          40: (2,4)
   4: (3)          21: (2,2,1)        41: (2,3,1)
   5: (2,1)        22: (2,1,2)        42: (2,2,2)
   6: (1,2)        23: (2,1,1,1)      43: (2,2,1,1)
   7: (1,1,1)      24: (1,4)          45: (2,1,2,1)
   8: (4)          25: (1,3,1)        47: (2,1,1,1,1)
   9: (3,1)        27: (1,2,1,1)      48: (1,5)
  10: (2,2)        31: (1,1,1,1,1)    49: (1,4,1)
  11: (2,1,1)      32: (6)            51: (1,3,1,1)
  12: (1,3)        33: (5,1)          55: (1,2,1,1,1)
  13: (1,2,1)      34: (4,2)          63: (1,1,1,1,1,1)
  15: (1,1,1,1)    35: (4,1,1)        64: (7)
  16: (5)          36: (3,3)          65: (6,1)
For example, (2,3,1,2) is such a composition because the non-adjacent pairs are (2,1), (2,2), (3,2), all of which are weakly decreasing, so 166 is in the sequence
		

Crossrefs

The case of normal sequences appears to be A028859.
Strict compositions are A032020.
A version for ordered set partitions is A332872.
These compositions are enumerated by A333148.
The strict case is enumerated by A333150.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],!MatchQ[stc[#],{_,x_,,y_,_}/;y>x]&]
Showing 1-8 of 8 results.