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-10 of 99 results. Next

A001523 Number of stacks, or planar partitions of n; also weakly unimodal compositions of n.

Original entry on oeis.org

1, 1, 2, 4, 8, 15, 27, 47, 79, 130, 209, 330, 512, 784, 1183, 1765, 2604, 3804, 5504, 7898, 11240, 15880, 22277, 31048, 43003, 59220, 81098, 110484, 149769, 202070, 271404, 362974, 483439, 641368, 847681, 1116325, 1464999, 1916184, 2498258, 3247088, 4207764
Offset: 0

Views

Author

Keywords

Comments

a(n) counts stacks of integer-length boards of total length n where no board overhangs the board underneath.
Number of graphical partitions on 2n nodes that contain a 1. E.g. a(3)=4 and so there are 4 graphical partitions of 6 that contain a 1, namely (111111), (21111), (2211) and (3111). Only (222) fails. - Jon Perry, Jul 25 2003
It would seem from Stanley that he regards a(0)=0 for this sequence and A001522. - Michael Somos, Feb 22 2015
In the article by Auluck is a typo in the formula (24), 2*Pi is missing in an exponent on the left side of the equation for Q(n). The correct term is exp(2*Pi*sqrt(n/3)), not just exp(sqrt(n/3)). - Vaclav Kotesovec, Jun 22 2015

Examples

			For a(4)=8 we have the following stacks:
x
x x. .x
x x. .x x.. .x. ..x xx
x xx xx xxx xxx xxx xx xxxx
G.f. = 1 + x + 2*x^2 + 4*x^3 + 8*x^4 + 15*x^5 + 27*x^6 + 47*x^7 + 79*x^8 + ...
From _Gus Wiseman_, Mar 04 2020: (Start)
The a(1) = 1 through a(5) = 15 unimodal compositions:
  (1)  (2)   (3)    (4)     (5)
       (11)  (12)   (13)    (14)
             (21)   (22)    (23)
             (111)  (31)    (32)
                    (112)   (41)
                    (121)   (113)
                    (211)   (122)
                    (1111)  (131)
                            (221)
                            (311)
                            (1112)
                            (1121)
                            (1211)
                            (2111)
                            (11111)
(End)
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 1, 1999; see section 2.5 on page 76.

Crossrefs

Cf. A000569. Bisections give A100505, A100506.
Row sums of A247255.
Row sums of A072704.
The strict case is A072706.
The complement is counted by A115981.
The case covering an initial interval is A227038.
The version whose negation is unimodal as well appears to be A329398.
Unimodal sequences covering an initial interval are A007052.
Non-unimodal permutations are A059204.
Non-unimodal sequences covering an initial interval are A328509.
Partitions with unimodal run-lengths are A332280.
Numbers whose prime signature is not unimodal are A332282.
Partitions whose 0-appended first differences are unimodal are A332283.
The number of unimodal permutations of the prime indices of n is A332288.
Compositions whose negation is unimodal are A332578.
Compositions whose run-lengths are unimodal are A332726.

Programs

  • Magma
    m:=100;
    R:=PowerSeriesRing(Integers(), m);
    Coefficients(R!( 1 + (&+[ x^n*(1-x^n)/(&*[(1-x^j)^2: j in [1..n]]): n in [1..m+2]]) )); // G. C. Greubel, Apr 03 2023
  • Maple
    b:= proc(n, i) option remember;
          `if`(i>n, 0, `if`(irem(n, i)=0, 1, 0)+
          add(b(n-i*j, i+1)*(j+1), j=0..n/i))
        end:
    a:= n-> `if`(n=0, 1, b(n, 1)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 26 2014
  • Mathematica
    max = 40; s = 1 + Sum[(-1)^(k + 1)*q^(k*(k + 1)/2), {k, 1, max}] / QPochhammer[q]^2 + O[q]^max; CoefficientList[s, q] (* Jean-François Alcover, Jan 25 2012, updated Nov 29 2015 *)
    b[n_, i_] := b[n, i] = If[i>n, 0, If[Mod[n, i]==0, 1, 0] + Sum[b[n-i*j, i+1]*(j+1), {j, 0, n/i}]]; a[n_] := If[n==0, 1, b[n, 1]]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Nov 24 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],unimodQ[#]&]],{n,0,10}] (* Gus Wiseman, Mar 04 2020 *)
  • PARI
    {a(n) = if( n<1, n==0, polcoeff( sum(k=1, (sqrt(1 + 8*n) - 1)\2, -(-1)^k * x^((k + k^2)/2)) / eta(x + x * O(x^n))^2 ,n))}; /* Michael Somos, Jul 22 2003 */
    
  • Python
    def b(n, i):
        if i>n: return 0
        if n%i==0: x=1
        else: x=0
        return x + sum([b(n - i*j, i + 1)*(j + 1) for j in range(n//i + 1)])
    def a(n): return 1 if n==0 else b(n, 1) # Indranil Ghosh, Jun 09 2017, after Maple code by Alois P. Heinz
    

Formula

a(n) = Sum_{k=1..n} f(k, n-k), where f(n, k) (= A054250) = 1 if k = 0; Sum_{j=1..min(n, k)} (n-j+1)*f(j, k-j) if k > 0. - David W. Wilson, May 05 2000
a(n) = Sum_{k} A059623(n, k) for n > 0. - Henry Bottomley, Feb 01 2001
A006330(n) + a(n) = A000712(n). - Michael Somos, Jul 22 2003
G.f.: 1 + (Sum_{k>0} -(-1)^k x^(k(k+1)/2))/(Product_{k>0} (1-x^k))^2. - Michael Somos, Jul 22 2003
G.f.: 1 + Sum_{n>=1} (x^n / ( ( Product_{k=1..n-1} (1 - x^k)^2 ) * (1-x^n) ) ). - Joerg Arndt, Oct 01 2012
a(n) ~ exp(2*Pi*sqrt(n/3)) / (8 * 3^(3/4) * n^(5/4)) [Auluck, 1951]. - Vaclav Kotesovec, Jun 22 2015
a(n) + A115981(n) = 2^(n - 1). - Gus Wiseman, Mar 04 2020

Extensions

More terms from David W. Wilson, May 05 2000
Definition corrected by Wolfdieter Lang, Dec 05 2018

A000212 a(n) = floor(n^2/3).

Original entry on oeis.org

0, 0, 1, 3, 5, 8, 12, 16, 21, 27, 33, 40, 48, 56, 65, 75, 85, 96, 108, 120, 133, 147, 161, 176, 192, 208, 225, 243, 261, 280, 300, 320, 341, 363, 385, 408, 432, 456, 481, 507, 533, 560, 588, 616, 645, 675, 705, 736, 768, 800, 833, 867, 901, 936
Offset: 0

Views

Author

Keywords

Comments

Let M_n be the n X n matrix of the following form: [3 2 1 0 0 0 0 0 0 0 / 2 3 2 1 0 0 0 0 0 0 / 1 2 3 2 1 0 0 0 0 0 / 0 1 2 3 2 1 0 0 0 0 / 0 0 1 2 3 2 1 0 0 0 / 0 0 0 1 2 3 2 1 0 0 / 0 0 0 0 1 2 3 2 1 0 / 0 0 0 0 0 1 2 3 2 1 / 0 0 0 0 0 0 1 2 3 2 / 0 0 0 0 0 0 0 1 2 3]. Then for n > 2 a(n) = det M_(n-2). - Benoit Cloitre, Jun 20 2002
Largest possible size for the directed Cayley graph on two generators having diameter n - 2. - Ralf Stephan, Apr 27 2003
It seems that for n >= 2, a(n) is the maximum number of non-overlapping 1 X 3 rectangles that can be packed into an n X n square. Rectangles can only be placed parallel to the sides of the square. Verified with Lobato's tool, see links. - Dmitry Kamenetsky, Aug 03 2009
Maximum number of edges in a K4-free graph with n vertices. - Yi Yang, May 23 2012
3a(n) + 1 = y^2 if n is not 0 mod 3 and 3a(n) = y^2 otherwise. - Jon Perry, Sep 10 2012
Apart from the initial term this is the elliptic troublemaker sequence R_n(1, 3) (also sequence R_n(2, 3)) in the notation of Stange (see Table 1, p. 16). For other elliptic troublemaker sequences R_n(a, b) see the cross references below. - Peter Bala, Aug 08 2013
The number of partitions of 2n into exactly 3 parts. - Colin Barker, Mar 22 2015
a(n-1) is the maximum number of non-overlapping triples (i,k), (i+1, k+1), (i+2, k+2) in an n X n matrix. Details: The triples are distributed along the main diagonal and 2*(n-1) other diagonals. Their maximum number is floor(n/3) + 2*Sum_{k = 1..n-1} floor(k/3) = floor((n-1)^2/3). - Gerhard Kirchner, Feb 04 2017
Conjecture: a(n) is the number of intersection points of n cevians that cut a triangle into the maximum number of pieces (see A007980). - Anton Zakharov, May 07 2017
From Gus Wiseman, Oct 05 2020: (Start)
Also the number of unimodal triples (meaning the middle part is not strictly less than both of the other two) of positive integers summing to n + 1. The a(2) = 1 through a(6) = 12 triples are:
(1,1,1) (1,1,2) (1,1,3) (1,1,4) (1,1,5)
(1,2,1) (1,2,2) (1,2,3) (1,2,4)
(2,1,1) (1,3,1) (1,3,2) (1,3,3)
(2,2,1) (1,4,1) (1,4,2)
(3,1,1) (2,2,2) (1,5,1)
(2,3,1) (2,2,3)
(3,2,1) (2,3,2)
(4,1,1) (2,4,1)
(3,2,2)
(3,3,1)
(4,2,1)
(5,1,1)
(End)

Examples

			G.f. = x^2 + 3*x^3 + 5*x^4 + 8*x^5 + 12*x^6 + 16*x^7 + 21*x^8 + 27*x^9 + 33*x^10 + ...
From _Gus Wiseman_, Oct 07 2020: (Start)
The a(2) = 1 through a(6) = 12 partitions of 2*n into exactly 3 parts (Barker) are the following. The Heinz numbers of these partitions are given by the intersection of A014612 (triples) and A300061 (even sum).
  (2,1,1)  (2,2,2)  (3,3,2)  (4,3,3)  (4,4,4)
           (3,2,1)  (4,2,2)  (4,4,2)  (5,4,3)
           (4,1,1)  (4,3,1)  (5,3,2)  (5,5,2)
                    (5,2,1)  (5,4,1)  (6,3,3)
                    (6,1,1)  (6,2,2)  (6,4,2)
                             (6,3,1)  (6,5,1)
                             (7,2,1)  (7,3,2)
                             (8,1,1)  (7,4,1)
                                      (8,2,2)
                                      (8,3,1)
                                      (9,2,1)
                                      (10,1,1)
(End)
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000290, A007590 (= R_n(2,4)), A002620 (= R_n(1,2)), A118015, A056827, A118013.
Cf. A033436 (= R_n(1,4) = R_n(3,4)), A033437 (= R_n(1,5) = R_n(4,5)), A033438 (= R_n(1,6) = R_n(5,6)), A033439 (= R_n(1,7) = R_n(6,7)), A033440, A033441, A033442, A033443, A033444.
Cf. A001353 and A004523 (first differences). A184535 (= R_n(2,5) = R_n(3,5)).
Cf. A238738. - Bruno Berselli, Apr 17 2015
Cf. A005408.
A000217(n-2) counts 3-part compositions.
A014612 ranks 3-part partitions, with strict case A007304.
A069905 counts the 3-part partitions.
A211540 counts strict 3-part partitions.
A337453 ranks strict 3-part compositions.
A001399(n-6)*4 is the strict version.
A001523 counts unimodal compositions, with strict case A072706.
A001840(n-4) is the non-unimodal version.
A001399(n-6)*2 is the strict non-unimodal version.
A007052 counts unimodal patterns.
A115981 counts non-unimodal compositions, ranked by A335373.
A011782 counts unimodal permutations.
A335373 is the complement of a ranking sequence for unimodal compositions.
A337459 ranks these compositions, with complement A337460.

Programs

  • Magma
    [Floor(n^2 / 3): n in [0..50]]; // Vincenzo Librandi, May 08 2011
    
  • Maple
    A000212:=(-1+z-2*z**2+z**3-2*z**4+z**5)/(z**2+z+1)/(z-1)**3; # Conjectured by Simon Plouffe in his 1992 dissertation. Gives sequence with an additional leading 1.
    A000212 := proc(n) option remember; `if`(n<4, [0,0,1,3][n+1], a(n-1)+a(n-3) -a(n-4)+2) end; # Peter Luschny, Nov 20 2011
  • Mathematica
    Table[Quotient[n^2, 3], {n, 0, 59}] (* Michael Somos, Jan 22 2014 *)
  • PARI
    {a(n) = n^2 \ 3}; /* Michael Somos, Sep 25 2006 */
    
  • Python
    def A000212(n): return n**2//3 # Chai Wah Wu, Jun 07 2022

Formula

G.f.: x^2*(1+x)/((1-x)^2*(1-x^3)). - Franklin T. Adams-Watters, Apr 01 2002
Euler transform of length 3 sequence [ 3, -1, 1]. - Michael Somos, Sep 25 2006
G.f.: x^2 * (1 - x^2) / ((1 - x)^3 * (1 - x^3)). a(-n) = a(n). - Michael Somos, Sep 25 2006
a(n) = Sum_{k = 0..n} A011655(k)*(n-k). - Reinhard Zumkeller, Nov 30 2009
a(n) = a(n-1) + a(n-3) - a(n-4) + 2 for n >= 4. - Alexander Burstein, Nov 20 2011
a(n) = a(n-3) + A005408(n-2) for n >= 3. - Alexander Burstein, Feb 15 2013
a(n) = (n-1)^2 - a(n-1) - a(n-2) for n >= 2. - Richard R. Forberg, Jun 05 2013
Sum_{n >= 2} 1/a(n) = (27 + 6*sqrt(3)*Pi + 2*Pi^2)/36. - Enrique Pérez Herrero, Jun 29 2013
0 = a(n)*(a(n+2) + a(n+3)) + a(n+1)*(-2*a(n+2) - a(n+3) + a(n+4)) + a(n+2)*(a(n+2) - 2*a(n+3) + a(n+4)) for all n in Z. - Michael Somos, Jan 22 2014
a(n) = Sum_{k = 1..n} k^2*A049347(n+2-k). - Mircea Merca, Feb 04 2014
a(n) = Sum_{i = 1..n+1} (ceiling(i/3) + floor(i/3) - 1). - Wesley Ivan Hurt, Jun 06 2014
a(n) = Sum_{j = 1..n} Sum_{i=1..n} ceiling((i+j-n-1)/3). - Wesley Ivan Hurt, Mar 12 2015
a(n) = Sum_{i = 1..n} floor(2*i/3). - Wesley Ivan Hurt, May 22 2017
a(-n) = a(n). - Paul Curtz, Jan 19 2020
a(n) = A001399(2*n - 3). - Gus Wiseman, Oct 07 2020
a(n) = (1/6)*(2*n^2 - 3 + gcd(n,3)). - Ridouane Oudra, Apr 15 2021
E.g.f.: (exp(x)*(-2 + 3*x*(1 + x)) + 2*exp(-x/2)*cos(sqrt(3)*x/2))/9. - Stefano Spezia, Oct 24 2022
Sum_{n>=2} (-1)^n/a(n) = Pi/sqrt(3) - Pi^2/36 - 3/4. - Amiram Eldar, Dec 02 2022

Extensions

Edited by Charles R Greathouse IV, Apr 19 2010

A328509 Number of non-unimodal sequences of length n covering an initial interval of positive integers.

Original entry on oeis.org

0, 0, 0, 3, 41, 425, 4287, 45941, 541219, 7071501, 102193755, 1622448861, 28090940363, 526856206877, 10641335658891, 230283166014653, 5315654596751659, 130370766738143517, 3385534662263335179, 92801587315936355325, 2677687796232803000171, 81124824998464533181661
Offset: 0

Views

Author

Gus Wiseman, Feb 19 2020

Keywords

Comments

A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.

Examples

			The a(3) = 3 sequences are (2,1,2), (2,1,3), (3,1,2).
The a(4) = 41 sequences:
  (1212)  (2113)  (2134)  (2413)  (3142)  (3412)
  (1213)  (2121)  (2143)  (3112)  (3212)  (4123)
  (1312)  (2122)  (2212)  (3121)  (3213)  (4132)
  (1323)  (2123)  (2213)  (3122)  (3214)  (4213)
  (1324)  (2131)  (2312)  (3123)  (3231)  (4231)
  (1423)  (2132)  (2313)  (3124)  (3241)  (4312)
  (2112)  (2133)  (2314)  (3132)  (3312)
		

Crossrefs

Not requiring non-unimodality gives A000670.
The complement is counted by A007052.
The case where the negation is not unimodal either is A332873.
Unimodal compositions are A001523.
Non-unimodal permutations are A059204.
Non-unimodal compositions are A115981.
Unimodal compositions covering an initial interval are A227038.
Numbers whose unsorted prime signature is not unimodal are A332282.
Covering partitions with unimodal run-lengths are A332577.
Non-unimodal compositions covering an initial interval are A332743.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    Table[Length[Select[Union@@Permutations/@allnorm[n],!unimodQ[#]&]],{n,0,5}]
  • PARI
    seq(n)=Vec( serlaplace(1/(2-exp(x + O(x*x^n)))) - (1 - 3*x + x^2)/(1 - 4*x + 2*x^2), -(n+1)) \\ Andrew Howroyd, Jan 28 2024

Formula

a(n) = A000670(n) - A007052(n-1) for n > 0. - Andrew Howroyd, Jan 28 2024

Extensions

a(9) from Robert Price, Jun 19 2021
a(10) onwards from Andrew Howroyd, Jan 28 2024

A332578 Number of compositions of n whose negation is unimodal.

Original entry on oeis.org

1, 1, 2, 4, 7, 13, 21, 36, 57, 91, 140, 217, 323, 485, 711, 1039, 1494, 2144, 3032, 4279, 5970, 8299, 11438, 15708, 21403, 29065, 39218, 52725, 70497, 93941, 124562, 164639, 216664, 284240, 371456, 484004, 628419, 813669, 1050144, 1351757, 1734873, 2221018, 2835613
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(1) = 1 through a(5) = 13 compositions:
  (1)  (2)   (3)    (4)     (5)
       (11)  (12)   (13)    (14)
             (21)   (22)    (23)
             (111)  (31)    (32)
                    (112)   (41)
                    (211)   (113)
                    (1111)  (122)
                            (212)
                            (221)
                            (311)
                            (1112)
                            (2111)
                            (11111)
		

Crossrefs

Dominated by A001523 (unimodal compositions).
The strict case is A072706.
The case that is unimodal also is A329398.
The complement is counted by A332669.
Row sums of A332670.
Unimodal normal sequences appear to be A007052.
Non-unimodal compositions are A115981.
Non-unimodal normal sequences are A328509.
Partitions whose run-lengths are unimodal are A332280.
Partitions whose negated run-lengths are unimodal are A332638.
Numbers whose unsorted prime signature is not unimodal are A332642.
Partitions whose negated 0-appended differences are unimodal are 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],unimodQ[-#]&]],{n,0,10}]
    nmax = 50; CoefficientList[Series[1 + Sum[x^j*(1 - x^j)/Product[1 - x^k, {k, j, nmax - j}]^2, {j, 1, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Mar 01 2020 *)
  • PARI
    seq(n)={Vec(1 + sum(j=1, n, x^j/((1-x^j)*prod(k=j+1, n-j, 1 - x^k + O(x*x^(n-j)))^2)))} \\ Andrew Howroyd, Mar 01 2020

Formula

a(n) + A332669(n) = 2^(n - 1).
G.f.: 1 + Sum_{j>0} x^j/((1 - x^j)*(Product_{k>j} 1 - x^k)^2). - Andrew Howroyd, Mar 01 2020
a(n) ~ Pi * exp(2*Pi*sqrt(n/3)) / (4 * 3^(5/4) * n^(7/4)). - Vaclav Kotesovec, Mar 01 2020

Extensions

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

A028859 a(n+2) = 2*a(n+1) + 2*a(n); a(0) = 1, a(1) = 3.

Original entry on oeis.org

1, 3, 8, 22, 60, 164, 448, 1224, 3344, 9136, 24960, 68192, 186304, 508992, 1390592, 3799168, 10379520, 28357376, 77473792, 211662336, 578272256, 1579869184, 4316282880, 11792304128, 32217174016, 88018956288, 240472260608, 656982433792, 1794909388800, 4903783645184, 13397386067968
Offset: 0

Views

Author

Keywords

Comments

Number of words of length n without adjacent 0's from the alphabet {0,1,2}. For example, a(2) counts 01,02,10,11,12,20,21,22. - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Jun 12 2001
Individually, both this sequence and A002605 are convergents to 1+sqrt(3). Mutually, both sequences are convergents to 2+sqrt(3) and 1+sqrt(3)/2. - Klaus E. Kastberg (kastberg(AT)hotkey.net.au), Nov 04 2001 [Can someone clarify what is meant by the obscure second phrase, "Mutually..."? - M. F. Hasler, Aug 06 2018]
Add a loop at two vertices of the graph C_3=K_3. a(n) counts walks of length n+1 between these vertices. - Paul Barry, Oct 15 2004
Prefaced with a 1 as (1 + x + 3x^2 + 8x^3 + 22x^4 + ...) = 1 / (1 - x - 2x^2 - 3x^3 - 5x^4 - 8x^5 - 13x^6 - 21x^7 - ...). - Gary W. Adamson, Jul 28 2009
Equals row 2 of the array in A180165, and the INVERTi transform of A125145. - Gary W. Adamson, Aug 14 2010
Pisano period lengths: 1, 1, 3, 1, 24, 3, 48, 1, 9, 24, 10, 3, 12, 48, 24, 1, 144, 9, 180, 24, .... - R. J. Mathar, Aug 10 2012
Also the number of independent vertex sets and vertex covers in the n-centipede graph. - Eric W. Weisstein, Sep 21 2017
From Gus Wiseman, May 19 2020: (Start)
Conjecture: Also the number of length n + 1 sequences that cover an initial interval of positive integers and whose non-adjacent parts are weakly decreasing. For example, (3,2,3,1,2) has non-adjacent pairs (3,3), (3,1), (3,2), (2,1), (2,2), (3,2), all of which are weakly decreasing, so is counted under a(11). The a(1) = 1 through a(3) = 8 sequences are:
(1) (11) (111)
(12) (121)
(21) (211)
(212)
(221)
(231)
(312)
(321)
The case of compositions is A333148, or A333150 for strict compositions, or A333193 for strictly decreasing parts. A version for ordered set partitions is A332872. Standard composition numbers of these compositions are A334966. Unimodal normal sequences are A227038. See also: A001045, A001523, A032020, A100471, A100881, A115981, A329398, A332836, A332872.
(End)
Number of 2-compositions of n+1 restricted to parts 1 and 2 (and allowed zeros); see Hopkins & Ouvry reference. - Brian Hopkins, Aug 16 2020
The number of ternary strings of length n not containing 00. Complement of A186244. - R. J. Mathar, Feb 13 2022

References

  • S. J. Cyvin and I. Gutman, Kekulé structures in benzenoid hydrocarbons, Lecture Notes in Chemistry, No. 46, Springer, New York, 1988 (see p. 73).

Crossrefs

Cf. A155020 (same sequence with term 1 prepended).
Cf. A002605.

Programs

  • Haskell
    a028859 n = a028859_list !! n
    a028859_list =
       1 : 3 : map (* 2) (zipWith (+) a028859_list (tail a028859_list))
    -- Reinhard Zumkeller, Oct 15 2011
    
  • Maple
    a[0]:=1:a[1]:=3:for n from 2 to 24 do a[n]:=2*a[n-1]+2*a[n-2] od: seq(a[n],n=0..24); # Emeric Deutsch
  • Mathematica
    a[n_]:=(MatrixPower[{{1,3},{1,1}},n].{{2},{1}})[[2,1]]; Table[a[n],{n,0,40}] (* Vladimir Joseph Stephan Orlovsky, Feb 20 2010 *)
    Table[2^(n - 1) Hypergeometric2F1[(1 - n)/2, -n/2, -n, -2], {n, 20}] (* Eric W. Weisstein, Jun 14 2017 *)
    LinearRecurrence[{2, 2}, {1, 3}, 20] (* Eric W. Weisstein, Jun 14 2017 *)
  • PARI
    a(n)=([1,3;1,1]^n*[2;1])[2,1] \\ Charles R Greathouse IV, Mar 27 2012
    
  • PARI
    A028859(n)=([1,1]*[2,2;1,0]^n)[1] \\ M. F. Hasler, Aug 06 2018

Formula

a(n) = a(n-1) + A052945(n) = A002605(n) + A002605(n-1).
G.f.: -(x+1)/(2*x^2+2*x-1).
a(n) = [(1+sqrt(3))^(n+2)-(1-sqrt(3))^(n+2)]/(4*sqrt(3)). - Emeric Deutsch, Feb 01 2005
If p[i]=fibonacci(i+1) and if A is the Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise. Then, for n>=1, a(n-1)= det A. - Milan Janjic, May 08 2010
a(n) = 3^n - A186244(n). - Toby Gottfried, Mar 07 2013
E.g.f.: exp(x)*(cosh(sqrt(3)*x) + 2*sinh(sqrt(3)*x)/sqrt(3)). - Stefano Spezia, Mar 02 2024

Extensions

Definition completed by M. F. Hasler, Aug 06 2018

A227038 Number of (weakly) unimodal compositions of n where all parts 1, 2, ..., m appear where m is the largest part.

Original entry on oeis.org

1, 1, 1, 3, 4, 7, 13, 19, 30, 44, 71, 98, 147, 205, 294, 412, 575, 783, 1077, 1456, 1957, 2634, 3492, 4627, 6082, 7980, 10374, 13498, 17430, 22451, 28767, 36806, 46803, 59467, 75172, 94839, 119285, 149599, 187031, 233355, 290340, 360327, 446222, 551251, 679524, 835964, 1026210
Offset: 0

Views

Author

Joerg Arndt, Jun 28 2013

Keywords

Examples

			There are a(8) = 30 such compositions of 8:
01:  [ 1 1 1 1 1 1 1 1 ]
02:  [ 1 1 1 1 1 1 2 ]
03:  [ 1 1 1 1 1 2 1 ]
04:  [ 1 1 1 1 2 1 1 ]
05:  [ 1 1 1 1 2 2 ]
06:  [ 1 1 1 2 1 1 1 ]
07:  [ 1 1 1 2 2 1 ]
08:  [ 1 1 1 2 3 ]
09:  [ 1 1 1 3 2 ]
10:  [ 1 1 2 1 1 1 1 ]
11:  [ 1 1 2 2 1 1 ]
12:  [ 1 1 2 2 2 ]
13:  [ 1 1 2 3 1 ]
14:  [ 1 1 3 2 1 ]
15:  [ 1 2 1 1 1 1 1 ]
16:  [ 1 2 2 1 1 1 ]
17:  [ 1 2 2 2 1 ]
18:  [ 1 2 2 3 ]
19:  [ 1 2 3 1 1 ]
20:  [ 1 2 3 2 ]
21:  [ 1 3 2 1 1 ]
22:  [ 1 3 2 2 ]
23:  [ 2 1 1 1 1 1 1 ]
24:  [ 2 2 1 1 1 1 ]
25:  [ 2 2 2 1 1 ]
26:  [ 2 2 3 1 ]
27:  [ 2 3 1 1 1 ]
28:  [ 2 3 2 1 ]
29:  [ 3 2 1 1 1 ]
30:  [ 3 2 2 1 ]
From _Gus Wiseman_, Mar 05 2020: (Start)
The a(1) = 1 through a(6) = 13 compositions:
  (1)  (11)  (12)   (112)   (122)    (123)
             (21)   (121)   (221)    (132)
             (111)  (211)   (1112)   (231)
                    (1111)  (1121)   (321)
                            (1211)   (1122)
                            (2111)   (1221)
                            (11111)  (2211)
                                     (11112)
                                     (11121)
                                     (11211)
                                     (12111)
                                     (21111)
                                     (111111)
(End)
		

Crossrefs

Cf. A001523 (unimodal compositions), A001522 (smooth unimodal compositions with first and last part 1), A001524 (unimodal compositions such that each up-step is by at most 1 and first part is 1).
Organizing by length rather than sum gives A007052.
The complement is counted by A332743.
The case of run-lengths of partitions is A332577, with complement A332579.
Compositions covering an initial interval are A107429.
Non-unimodal compositions are A115981.

Programs

  • Maple
    b:= proc(n,i) option remember;
          `if`(i>n, 0, `if`(irem(n, i)=0, 1, 0)+
          add(b(n-i*j, i+1)*(j+1), j=1..n/i))
        end:
    a:= n-> `if`(n=0, 1, b(n, 1)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 26 2014
  • Mathematica
    b[n_, i_] := b[n, i] = If[i>n, 0, If[Mod[n, i] == 0, 1, 0] + Sum[b[n-i*j, i+1]*(j+1), {j, 1, n/i}]]; a[n_] := If[n==0, 1, b[n, 1]]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Apr 09 2015, after Alois P. Heinz *)
    normQ[m_]:=m=={}||Union[m]==Range[Max[m]];
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],normQ[#]&&unimodQ[#]&]],{n,0,10}] (* Gus Wiseman, Mar 05 2020 *)

Formula

a(n) ~ c * exp(Pi*sqrt(r*n)) / n, where r = 0.9409240878664458093345791978063..., c = 0.05518035191234679423222212249... - Vaclav Kotesovec, Mar 04 2020
a(n) + A332743(n) = 2^(n - 1). - Gus Wiseman, Mar 05 2020

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

A332282 Numbers whose unsorted prime signature is not unimodal.

Original entry on oeis.org

300, 588, 600, 980, 1176, 1200, 1452, 1500, 1960, 2028, 2100, 2205, 2352, 2400, 2420, 2904, 2940, 3000, 3300, 3380, 3388, 3468, 3900, 3920, 4056, 4116, 4200, 4332, 4410, 4704, 4732, 4800, 4840, 5100, 5445, 5700, 5780, 5808, 5880, 6000, 6348, 6468, 6600, 6615
Offset: 1

Views

Author

Gus Wiseman, Feb 19 2020

Keywords

Comments

The unsorted prime signature of a positive integer (row n of A124010) is the sequence of exponents it is prime factorization.
A sequence of positive integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.
Also Heinz numbers of integer partitions with non-unimodal run-lengths. The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			The sequence of terms together with their prime indices begins:
   300: {1,1,2,3,3}
   588: {1,1,2,4,4}
   600: {1,1,1,2,3,3}
   980: {1,1,3,4,4}
  1176: {1,1,1,2,4,4}
  1200: {1,1,1,1,2,3,3}
  1452: {1,1,2,5,5}
  1500: {1,1,2,3,3,3}
  1960: {1,1,1,3,4,4}
  2028: {1,1,2,6,6}
  2100: {1,1,2,3,3,4}
  2205: {2,2,3,4,4}
  2352: {1,1,1,1,2,4,4}
  2400: {1,1,1,1,1,2,3,3}
  2420: {1,1,3,5,5}
  2904: {1,1,1,2,5,5}
  2940: {1,1,2,3,4,4}
  3000: {1,1,1,2,3,3,3}
  3300: {1,1,2,3,3,5}
  3380: {1,1,3,6,6}
		

Crossrefs

The opposite version is A332642.
These are the Heinz numbers of the partitions counted by A332281.
Non-unimodal permutations are A059204.
Non-unimodal compositions are A115981.
Non-unimodal normal sequences are A328509.

Programs

  • Mathematica
    unimodQ[q_]:=Or[Length[q]==1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    Select[Range[1000],!unimodQ[Last/@FactorInteger[#]]&]

A332834 Number of compositions of n that are neither weakly increasing nor weakly decreasing.

Original entry on oeis.org

0, 0, 0, 0, 1, 4, 14, 36, 88, 199, 432, 914, 1900, 3896, 7926, 16036, 32311, 64944, 130308, 261166, 523040, 1046996, 2095152, 4191796, 8385466, 16773303, 33549564, 67102848, 134210298, 268426328, 536859712, 1073728142, 2147466956, 4294947014, 8589909976
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.

Examples

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

Crossrefs

The version for unsorted prime signature is A332831.
The version for run-lengths of compositions is A332833.
The complement appears to be counted by A329398.
Unimodal compositions are A001523.
Compositions that are not unimodal are A115981.
Partitions with weakly increasing or decreasing run-lengths are A332745.
Compositions with weakly increasing or decreasing run-lengths are A332835.
Compositions with weakly increasing run-lengths are A332836.
Compositions that are neither unimodal nor is their negation are A332870.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!Or[LessEqual@@#,GreaterEqual@@#]&]],{n,0,10}]
  • PARI
    a(n)={if(n==0, 0, 2^(n-1) - 2*numbpart(n) + numdiv(n))} \\ Andrew Howroyd, Dec 30 2020

Formula

a(n) = 2^(n - 1) - 2 * A000041(n) + A000005(n).

A332280 Number of integer partitions of n with unimodal run-lengths.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 41, 55, 75, 97, 129, 166, 215, 273, 352, 439, 557, 692, 865, 1066, 1325, 1614, 1986, 2413, 2940, 3546, 4302, 5152, 6207, 7409, 8862, 10523, 12545, 14814, 17562, 20690, 24397, 28615, 33645, 39297, 46009, 53609, 62504, 72581, 84412
Offset: 0

Views

Author

Gus Wiseman, Feb 18 2020

Keywords

Comments

First differs from A000041 at a(10) = 41, A000041(10) = 42.
A sequence of positive integers is unimodal if it is the concatenation of a weakly increasing followed by a weakly decreasing sequence.

Examples

			The a(10) = 41 partitions (A = 10) are:
  (A)     (61111)   (4321)     (3211111)
  (91)    (55)      (43111)    (31111111)
  (82)    (541)     (4222)     (22222)
  (811)   (532)     (42211)    (222211)
  (73)    (5311)    (421111)   (2221111)
  (721)   (5221)    (4111111)  (22111111)
  (7111)  (52111)   (3331)     (211111111)
  (64)    (511111)  (3322)     (1111111111)
  (631)   (442)     (331111)
  (622)   (4411)    (32221)
  (6211)  (433)     (322111)
Missing from this list is only (33211).
		

Crossrefs

The complement is counted by A332281.
Heinz numbers of these partitions are the complement of A332282.
Taking 0-appended first-differences instead of run-lengths gives A332283.
The normal case is A332577.
The opposite version is A332638.
Unimodal compositions are A001523.
Unimodal normal sequences are A007052.
Numbers whose unsorted prime signature is unimodal are A332288.

Programs

  • Maple
    b:= proc(n, i, m, t) option remember; `if`(n=0, 1,
         `if`(i<1, 0, add(b(n-i*j, i-1, j, t and j>=m),
          j=1..min(`if`(t, [][], m), n/i))+b(n, i-1, m, t)))
        end:
    a:= n-> b(n$2, 0, true):
    seq(a(n), n=0..65);  # Alois P. Heinz, Feb 20 2020
  • Mathematica
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]]
    Table[Length[Select[IntegerPartitions[n],unimodQ[Length/@Split[#]]&]],{n,0,30}]
    (* Second program: *)
    b[n_, i_, m_, t_] := b[n, i, m, t] = If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1, j, t && j >= m], {j, 1, Min[If[t, Infinity, m], n/i]}] + b[n, i - 1, m, t]]];
    a[n_] := b[n, n, 0, True];
    a /@ Range[0, 65] (* Jean-François Alcover, May 10 2021, after Alois P. Heinz *)
Showing 1-10 of 99 results. Next