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

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

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

A332670 Triangle read by rows where T(n,k) is the number of length-k compositions of n whose negation is unimodal.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 2, 1, 0, 1, 4, 5, 2, 1, 0, 1, 5, 7, 5, 2, 1, 0, 1, 6, 11, 10, 5, 2, 1, 0, 1, 7, 15, 16, 10, 5, 2, 1, 0, 1, 8, 20, 24, 20, 10, 5, 2, 1, 0, 1, 9, 25, 36, 31, 20, 10, 5, 2, 1, 0, 1, 10, 32, 50, 50, 36, 20, 10, 5, 2, 1
Offset: 0

Views

Author

Gus Wiseman, Feb 29 2020

Keywords

Comments

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

Examples

			Triangle begins:
  1
  0  1
  0  1  1
  0  1  2  1
  0  1  3  2  1
  0  1  4  5  2  1
  0  1  5  7  5  2  1
  0  1  6 11 10  5  2  1
  0  1  7 15 16 10  5  2  1
  0  1  8 20 24 20 10  5  2  1
  0  1  9 25 36 31 20 10  5  2  1
  0  1 10 32 50 50 36 20 10  5  2  1
  0  1 11 38 67 73 59 36 20 10  5  2  1
Column n = 7 counts the following compositions:
  (7)  (16)  (115)  (1114)  (11113)  (111112)  (1111111)
       (25)  (124)  (1123)  (11122)  (211111)
       (34)  (133)  (1222)  (21112)
       (43)  (214)  (2113)  (22111)
       (52)  (223)  (2122)  (31111)
       (61)  (313)  (2212)
             (322)  (2221)
             (331)  (3112)
             (412)  (3211)
             (421)  (4111)
             (511)
		

Crossrefs

The case of partitions is A072233.
Dominated by A072704 (the non-negated version).
The strict case is A072705.
The case of constant compositions is A113704.
Row sums are A332578.
Unimodal compositions are A001523.
Unimodal normal sequences appear to be A007052.
Non-unimodal compositions are A115981.
Non-unimodal normal sequences are A328509.
Numbers whose negated unsorted prime signature is not unimodal are A332282.
Partitions whose negated run-lengths are unimodal are A332638.
Compositions whose negation is not unimodal are A332669.
Partitions whose negated 0-appended first differences are unimodal: A332728.

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,{k}],unimodQ[-#]&]],{n,0,10},{k,0,n}]
  • PARI
    T(n)={[Vecrev(p) | p<-Vec(1 + sum(j=1, n, y*x^j/((1-y*x^j) * prod(k=j+1, n-j, 1 - y*x^k + O(x*x^(n-j)))^2)))]}
    { my(A=T(10)); for(n=1, #A, print(A[n])) } \\ Andrew Howroyd, Jan 11 2024

Formula

G.f.: A(x,y) = 1 + Sum_{j>0} y*x^j/((1 - y*x^j)*Product_{k>j} (1 - y*x^k)^2). - Andrew Howroyd, Jan 11 2024

A128422 Projective plane crossing number of K_{4,n}.

Original entry on oeis.org

0, 0, 0, 2, 4, 6, 10, 14, 18, 24, 30, 36, 44, 52, 60, 70, 80, 90, 102, 114, 126, 140, 154, 168, 184, 200, 216, 234, 252, 270, 290, 310, 330, 352, 374, 396, 420, 444, 468, 494, 520, 546, 574, 602, 630, 660, 690, 720, 752, 784, 816, 850, 884, 918, 954, 990, 1026
Offset: 1

Views

Author

Eric W. Weisstein, Mar 02 2007

Keywords

Comments

From Gus Wiseman, Oct 15 2020: (Start)
Also the number of 3-part compositions of n that are neither strictly increasing nor weakly decreasing. The set of numbers k such that row k of A066099 is such a composition is the complement of A333255 (strictly increasing) and A114994 (weakly decreasing) in A014311 (triples). The a(4) = 2 through a(9) = 14 compositions are:
(1,1,2) (1,1,3) (1,1,4) (1,1,5) (1,1,6) (1,1,7)
(1,2,1) (1,2,2) (1,3,2) (1,3,3) (1,4,3) (1,4,4)
(1,3,1) (1,4,1) (1,4,2) (1,5,2) (1,5,3)
(2,1,2) (2,1,3) (1,5,1) (1,6,1) (1,6,2)
(2,3,1) (2,1,4) (2,1,5) (1,7,1)
(3,1,2) (2,2,3) (2,2,4) (2,1,6)
(2,3,2) (2,3,3) (2,2,5)
(2,4,1) (2,4,2) (2,4,3)
(3,1,3) (2,5,1) (2,5,2)
(4,1,2) (3,1,4) (2,6,1)
(3,2,3) (3,1,5)
(3,4,1) (3,2,4)
(4,1,3) (3,4,2)
(5,1,2) (3,5,1)
(4,1,4)
(4,2,3)
(5,1,3)
(6,1,2)
(End)

Crossrefs

A007997 counts the complement.
A337482 counts these compositions of any length.
A337484 is the non-strict/non-strict version.
A000009 counts strictly increasing compositions, ranked by A333255.
A000041 counts weakly decreasing compositions, ranked by A114994.
A001523 counts unimodal compositions (strict: A072706).
A007318 and A097805 count compositions by length.
A032020 counts strict compositions, ranked by A233564.
A225620 ranks weakly increasing compositions.
A333149 counts neither increasing nor decreasing strict compositions.
A333256 ranks strictly decreasing compositions.
A337483 counts 3-part weakly increasing or weakly decreasing compositions.

Programs

  • Mathematica
    Table[Floor[((n - 2)^2 + (n - 2))/3], {n, 1, 100}] (* Vladimir Joseph Stephan Orlovsky, Jan 31 2012 *)
    Table[Ceiling[n^2/3] - n, {n, 20}] (* Eric W. Weisstein, Sep 07 2018 *)
    Table[(3 n^2 - 9 n + 4 - 4 Cos[2 n Pi/3])/9, {n, 20}] (* Eric W. Weisstein, Sep 07 2018 *)
    LinearRecurrence[{2, -1, 1, -2, 1}, {0, 0, 0, 2, 4, 6}, 20] (* Eric W. Weisstein, Sep 07 2018 *)
    CoefficientList[Series[-2 x^3/((-1 + x)^3 (1 + x + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 07 2018 *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{3}],!Less@@#&&!GreaterEqual@@#&]],{n,15}] (* Gus Wiseman, Oct 15 2020 *)
  • PARI
    a(n)=(n-1)*(n-2)\3 \\ Charles R Greathouse IV, Jun 06 2013

Formula

a(n) = floor(n/3)*(2n-3(floor(n/3)+1)).
a(n) = ceiling(n^2/3) - n. - Charles R Greathouse IV, Jun 06 2013
G.f.: -2*x^4 / ((x-1)^3*(x^2+x+1)). - Colin Barker, Jun 06 2013
a(n) = floor((n - 1)(n - 2) / 3). - Christopher Hunt Gribble, Oct 13 2009
a(n) = 2*A001840(n-3). - R. J. Mathar, Jul 21 2015
a(n) = A000217(n-2) - A001399(n-6) - A001399(n-3). - Gus Wiseman, Oct 15 2020
Sum_{n>=4} 1/a(n) = 10/3 - Pi/sqrt(3). - Amiram Eldar, Sep 27 2022

A072707 Number of non-unimodal compositions of n into distinct terms.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 24, 26, 46, 64, 100, 224, 276, 416, 590, 850, 1144, 2214, 2644, 3938, 5282, 7504, 9776, 13704, 21984, 27632, 38426, 51562, 69844, 91950, 123504, 159658, 246830, 303400, 416068, 540480, 730268, 933176, 1248110
Offset: 0

Views

Author

Henry Bottomley, Jul 04 2002

Keywords

Comments

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

Examples

			a(6)=2 since 6 can be written as 2+1+3 or 3+1+2.
From _Gus Wiseman_, Mar 05 2020: (Start)
The a(6) = 2 through a(9) = 6 strict compositions:
  (2,1,3)  (2,1,4)  (2,1,5)  (2,1,6)
  (3,1,2)  (4,1,2)  (3,1,4)  (3,1,5)
                    (4,1,3)  (3,2,4)
                    (5,1,2)  (4,2,3)
                             (5,1,3)
                             (6,1,2)
(End)
		

Crossrefs

The complement is counted by A072706.
The non-strict version is A115981.
The case where the negation is not unimodal either is A332874.
Unimodal compositions are A001523.
Strict compositions are A032020.
Non-unimodal permutations are A059204.
A triangle for strict unimodal compositions is A072705.
Non-unimodal sequences covering an initial interval are A328509.
Numbers whose prime signature is not unimodal are A332282.
Strict partitions whose 0-appended differences are not unimodal are A332286.
Compositions whose negation is unimodal are A332578.
Compositions whose negation is not unimodal are A332669.
Non-unimodal compositions covering an initial interval are A332743.

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],UnsameQ@@#&&!unimodQ[#]&]],{n,0,16}] (* Gus Wiseman, Mar 05 2020 *)

Formula

a(n) = A032020(n) - A072706(n) = Sum_{k} A059204(k) * A060016(n, k).

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.
Showing 1-6 of 6 results.