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 88 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

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

A007070 a(n) = 4*a(n-1) - 2*a(n-2) with a(0) = 1, a(1) = 4.

Original entry on oeis.org

1, 4, 14, 48, 164, 560, 1912, 6528, 22288, 76096, 259808, 887040, 3028544, 10340096, 35303296, 120532992, 411525376, 1405035520, 4797091328, 16378294272, 55918994432, 190919389184, 651839567872, 2225519493120, 7598398836736, 25942556360704, 88573427769344, 302408598355968
Offset: 0

Views

Author

Keywords

Comments

Joe Keane (jgk(AT)jgk.org) observes that this sequence (beginning at 4) is "size of raises in pot-limit poker, one blind, maximum raising."
It appears that this sequence is the BinomialMean transform of A002315 - see A075271. - John W. Layman, Oct 02 2002
Number of (s(0), s(1), ..., s(2n+3)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n+3, s(0) = 1, s(2n+3) = 4. - Herbert Kociemba, Jun 11 2004
a(n) = number of distinct matrix products in (A+B+C+D)^n where commutators [A,B]=[C,D]=0 but neither A nor B commutes with C or D. - Paul D. Hanna and Joshua Zucker, Feb 01 2006
The n-th term of the sequence is the entry (1,2) in the n-th power of the matrix M=[1,-1;-1,3]. - Simone Severini, Feb 15 2006
Hankel transform of this sequence is [1,-2,0,0,0,0,0,0,0,0,0,...]. - Philippe Deléham, Nov 21 2007
A204089 convolved with A000225, e.g., a(4) = 164 = (1*31 + 1*15 + 4*7 + 14*3 + 48*1) = (31 + 15 + 28 + 42 + 48). - Gary W. Adamson, Dec 23 2008
Equals INVERT transform of A000225: (1, 3, 7, 15, 31, ...). - Gary W. Adamson, May 03 2009
For n>=1, a(n-1) is the number of generalized compositions of n when there are 2^i-1 different types of the part i, (i=1,2,...). - Milan Janjic, Sep 24 2010
Binomial transform of A078057. - R. J. Mathar, Mar 28 2011
Pisano period lengths: 1, 1, 8, 1, 24, 8, 6, 1, 24, 24, 120, 8, 168, 6, 24, 1, 8, 24, 360, 24, ... . - R. J. Mathar, Aug 10 2012
a(n) is the diagonal of array A228405. - Richard R. Forberg, Sep 02 2013
From Wolfdieter Lang, Oct 01 2013: (Start)
a(n) appears together with A106731, both interspersed with zeros, in the representation of nonnegative powers of the algebraic number rho(8) = 2*cos(Pi/8) = A179260 of degree 4, which is the length ratio of the smallest diagonal and the side in the regular octagon.
The minimal polynomial for rho(8) is C(8,x) = x^4 - 4*x^2 + 2, hence rho(8)^n = A(n+1)*1 + A(n)*rho(8) + B(n+1)*rho(8)^2 + B(n)*rho(8)^3, n >= 0, with A(2*k) = 0, k >= 0, A(1) = 1, A(2*k+1) = A106731(k-1), k >= 1, and B(2*k) = 0, k >= 0, B(1) = 0, B(2*k+1) = a(k-1), k >= 1. See also the P. Steinbach reference given under A049310. (End)
The ratio a(n)/A006012(n) converges to 1+sqrt(2). - Karl V. Keller, Jr., May 16 2015
From Tom Copeland, Dec 04 2015: (Start)
An aerated version of this sequence is given by the o.g.f. = 1 / (1 - 4 x^2 + 2 x^4) = 1 / [x^4 a_4(1/x)] = 1 / determinant(I - x M) = exp[-log(1 -4 x + 2 x^4)], where M is the adjacency matrix for the simple Lie algebra B_4 given in A265185 with the characteristic polynomial a_4(x) = x^4 - 4 x^2 + 2 = 2 T_4(x/2) = A127672(4,x), where T denotes a Chebyshev polynomial of the first kind.
A133314 relates a(n) to the reciprocal of the e.g.f. 1 - 4 x + 4 x^2/2!. (End)
a(n) is the number of vertices of the Minkowski sum of n simplices with vertices e_(2*i+1), e_(2*i+2), e_(2*i+3), e_(2*i+4) for i=0,...,n-1, where e_i is a standard basis vector. - Alejandro H. Morales, Oct 03 2022

Examples

			a(3) = 48 = 3 * 4 + 4 + 1 + 1 = 3*a(2) + a(1) + a(0) + 1.
Example for the octagon rho(8) powers: rho(8)^4  = 2 + sqrt(2) = -2*1 + 4*rho(8)^2  = A(5)*1 + A(4)*rho(8) + B(5)*rho(8)^2 + B(4)*rho(8)^3, with a(5) = A106731(1) = -2, B(5) = a(1) = 4, A(4) = 0, B(4) = 0. - _Wolfdieter Lang_, Oct 01 2013
		

References

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

Crossrefs

Row sums of A059474. - David W. Wilson, Aug 14 2006
Equals 2 * A003480, n>0.
Row sums of A140071.

Programs

  • Haskell
    a007070 n = a007070_list !! n
    a007070_list = 1 : 4 : (map (* 2) $ zipWith (-)
       (tail $ map (* 2) a007070_list) a007070_list)
    -- Reinhard Zumkeller, Jan 16 2012
  • Magma
    Z:=PolynomialRing(Integers()); N:=NumberField(x^2-8); S:=[ ((4+r)^(1+n)-(4-r)^(1+n))/((2^(1+n))*r): n in [0..20] ]; [ Integers()!S[j]: j in [1..#S] ]; // Vincenzo Librandi, Mar 27 2011
    
  • Magma
    [n le 2 select 3*n-2 else 4*Self(n-1)-2*Self(n-2): n in [1..23]];  // Bruno Berselli, Mar 28 2011
    
  • Maple
    A007070 :=proc(n) option remember; if n=0 then 1 elif n=1 then 4 else 4*procname(n-1)-2*procname(n-2); fi; end:
    seq(A007070(n), n=0..30); # Wesley Ivan Hurt, Dec 06 2015
  • Mathematica
    LinearRecurrence[{4,-2}, {1,4}, 30] (* Harvey P. Dale, Sep 16 2014 *)
  • PARI
    a(n)=polcoeff(1/(1-4*x+2*x^2)+x*O(x^n),n)
    
  • PARI
    a(n)=if(n<1,1,ceil((2+sqrt(2))*a(n-1)))
    
  • Sage
    [lucas_number1(n,4,2) for n in range(1, 24)]# Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: 1/(1 - 4*x + 2*x^2).
Preceded by 0, this is the binomial transform of the Pell numbers A000129. Its e.g.f. is then exp(2*x)*sinh(sqrt(2)*x)/sqrt(2). - Paul Barry, May 09 2003
a(n) = ((2+sqrt(2))^(n+1) - (2-sqrt(2))^(n+1))/sqrt(8). - Al Hakanson (hawkuu(AT)gmail.com), Dec 27 2008, corrected Mar 28 2011
a(n) = (2 - sqrt(2))^n*(1/2 - sqrt(2)/2) + (2 + sqrt(2))^n*(1/2 + sqrt(2)/2). - Paul Barry, May 09 2003
a(n) = ceiling((2 + sqrt(2))*a(n-1)). - Benoit Cloitre, Aug 15 2003
a(n) = U(n, sqrt(2))*sqrt(2)^n. - Paul Barry, Nov 19 2003
a(n) = (1/4)*Sum_{r=1..7} sin(r*Pi/8)*sin(r*Pi/2)*(2*cos(r*Pi/8))^(2*n+3). - Herbert Kociemba, Jun 11 2004
a(n) = center term in M^n * [1 1 1], where M = the 3 X 3 matrix [1 1 1 / 1 2 1 / 1 1 1]. M^n * [1 1 1] = [A007052(n) a(n) A007052(n)]. E.g., a(3) = 48 since M^3 * [1 1 1] = [34 48 34], where 34 = A007052(3). - Gary W. Adamson, Dec 18 2004
This is the binomial mean transform of A002307. See Spivey and Steil (2006). - Michael Z. Spivey (mspivey(AT)ups.edu), Feb 26 2006
a(2n) = Sum_{r=0..n} 2^(2n-1-r)*(4*binomial(2n-1,2r) + 3*binomial(2n-1,2r+1)) a(2n-1) = Sum_{r=0..n} 2^(2n-2-r)*(4*binomial(2n-2,2r) + 3*binomial(2n-2,2r+1)). - Jeffrey Liese, Oct 12 2006
a(n) = 3*a(n - 1) + a(n - 2) + a(n - 3) + ... + a(0) + 1. - Gary W. Adamson, Feb 18 2011
G.f.: 1/(1 - 4*x + 2*x^2) = 1/( x*(1 + U(0)) ) - 1/x where U(k)= 1 - 2^k/(1 - x/(x - 2^k/U(k+1) )); (continued fraction 3rd kind, 3-step). - Sergei N. Gladkovskii, Dec 05 2012
G.f.: A(x) = G(0)/(1-2*x) where G(k) = 1 + 2*x/(1 - 2*x - x*(1-2*x)/(x + (1-2*x)/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Jan 04 2013
G.f.: G(0)/(2*x) - 1/x, where G(k) = 1 + 1/(1 - x*(2*k-1)/(x*(2*k+1) - (1-x)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 26 2013
a(n-1) = Sum_{k=0..n} binomial(2*n, n+k)*(k|8) where (k|8) is the Kronecker symbol. - Greg Dresden, Oct 11 2022
E.g.f.: exp(2*x)*(cosh(sqrt(2)*x) + sqrt(2)*sinh(sqrt(2)*x)). - Stefano Spezia, May 20 2024

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

A001840 Expansion of g.f. x/((1 - x)^2*(1 - x^3)).

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 9, 12, 15, 18, 22, 26, 30, 35, 40, 45, 51, 57, 63, 70, 77, 84, 92, 100, 108, 117, 126, 135, 145, 155, 165, 176, 187, 198, 210, 222, 234, 247, 260, 273, 287, 301, 315, 330, 345, 360, 376, 392, 408, 425, 442, 459, 477, 495, 513, 532, 551, 570, 590
Offset: 0

Views

Author

Keywords

Comments

a(n-3) is the number of aperiodic necklaces (Lyndon words) with 3 black beads and n-3 white beads.
Number of triangular partitions (see Almkvist).
Consists of arithmetic progression quadruples of common difference n+1 starting at A045943(n). Refers to the least number of coins needed to be rearranged in order to invert the pattern of a (n+1)-rowed triangular array. For instance, a 5-rowed triangular array requires a minimum of a(4)=5 rearrangements (shown bracketed here) for it to be turned upside down.
.....{*}..................{*}*.*{*}{*}
.....*.*....................*.*.*.{*}
....*.*.*....---------\......*.*.*
..{*}*.*.*...---------/.......*.*
{*}{*}*.*{*}..................{*}
- Lekraj Beedassy, Oct 13 2003
Partial sums of 1,1,1,2,2,2,3,3,3,4,4,4,... - Jon Perry, Mar 01 2004
Sum of three successive terms is a triangular number in natural order starting with 3: a(n)+a(n+1)+a(n+2) = T(n+2) = (n+2)*(n+3)/2. - Amarnath Murthy, Apr 25 2004
Apply Riordan array (1/(1-x^3),x) to n. - Paul Barry, Apr 16 2005
Absolute values of numbers that appear in A145919. - Matthew Vandermast, Oct 28 2008
In the Moree definition, (-1)^n*a(n) is the 3rd Witt transform of A033999 and (-1)^n*A004524(n) with 2 leading zeros dropped is the 2nd Witt transform of A033999. - R. J. Mathar, Nov 08 2008
Column sums of:
1 2 3 4 5 6 7 8 9.....
1 2 3 4 5 6.....
1 2 3.....
........................
----------------------
1 2 3 5 7 9 12 15 18 - Jon Perry, Nov 16 2010
a(n) is the sum of the positive integers <= n that have the same residue modulo 3 as n. They are the additive counterpart of the triple factorial numbers. - Peter Luschny, Jul 06 2011
a(n+1) is the number of 3-tuples (w,x,y) with all terms in {0,...,n} and w=3*x+y. - Clark Kimberling, Jun 04 2012
a(n+1) is the number of pairs (x,y) with x and y in {0,...,n}, x-y = (1 mod 3), and x+y < n. - Clark Kimberling, Jul 02 2012
a(n+1) is the number of partitions of n into two sorts of part(s) 1 and one sort of (part) 3. - Joerg Arndt, Jun 10 2013
Arrange A004523 in rows successively shifted to the right two spaces and sum the columns:
1 2 2 3 4 4 5 6 6...
1 2 2 3 4 4 5...
1 2 2 3 4...
1 2 2...
1...
------------------------------
1 2 3 5 7 9 12 15 18... - L. Edson Jeffery, Jul 30 2014
a(n) = A258708(n+1,1) for n > 0. - Reinhard Zumkeller, Jun 23 2015
Also the number of triples of positive integers summing to n + 4, the first less than each of the other two. Also the number of triples of positive integers summing to n + 2, the first less than or equal to each of the other two. - Gus Wiseman, Oct 11 2020
Also the lower matching number of the (n+1)-triangular honeycomb king graph = n-triangular grid graph (West convention). - Eric W. Weisstein, Dec 14 2024

Examples

			G.f. = x + 2*x^2 + 3*x^3 + 5*x^4 + 7*x^5 + 9*x^6 + 12*x^7 + 15*x^8 + 18*x^9 + ...
1+2+3=6=t(3), 2+3+5=t(4), 5+7+9=t(5).
[n] a(n)
--------
[1] 1
[2] 2
[3] 3
[4] 1 + 4
[5] 2 + 5
[6] 3 + 6
[7] 1 + 4 + 7
[8] 2 + 5 + 8
[9] 3 + 6 + 9
a(7) = floor(2/3) +floor(3/3) +floor(4/3) +floor(5/3) +floor(6/3) +floor(7/3) +floor(8/3) +floor(9/3) = 12. - _Bruno Berselli_, Aug 29 2013
		

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 73, problem 25.
  • Ulrich Faigle, Review of Gerhard Post and G.J. Woeginger, Sports tournaments, home-away assignments and the break minimization problem, MR2224983(2007b:90134), 2007.
  • Hansraj Gupta, Partitions of j-partite numbers into twelve or a smaller number of parts. Collection of articles dedicated to Professor P. L. Bhatnagar on his sixtieth birthday. Math. Student 40 (1972), 401-441 (1974).
  • Richard K. Guy, A problem of Zarankiewicz, in P. Erdős and G. Katona, editors, Theory of Graphs (Proceedings of the Colloquium, Tihany, Hungary), Academic Press, NY, 1968, pp. 119-150, (p. 126, divided by 2).
  • 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

Ordered union of triangular matchstick numbers A045943 and generalized pentagonal numbers A001318.
Cf. A058937.
A column of triangle A011847.
Cf. A258708.
A001399 counts 3-part partitions, ranked by A014612.
A337483 counts either weakly increasing or weakly decreasing triples.
A337484 counts neither strictly increasing nor strictly decreasing triples.
A014311 ranks 3-part compositions, with strict case A337453.

Programs

  • Haskell
    a001840 n = a001840_list !! n
    a001840_list = scanl (+) 0 a008620_list
    -- Reinhard Zumkeller, Apr 16 2012
  • Magma
    [ n le 2 select n else n*(n+1)/2-Self(n-1)-Self(n-2): n in [1..58] ];  // Klaus Brockhaus, Oct 01 2009
    
  • Maple
    A001840 := n->floor((n+1)*(n+2)/6);
    A001840:=-1/((z**2+z+1)*(z-1)**3); # conjectured (correctly) by Simon Plouffe in his 1992 dissertation
    seq(floor(binomial(n-1,2)/3), n=3..61); # Zerinvary Lajos, Jan 12 2009
    A001840 :=  n -> add(k, k = select(k -> k mod 3 = n mod 3, [$1 .. n])): seq(A001840(n), n = 0 .. 58); # Peter Luschny, Jul 06 2011
  • Mathematica
    a[0]=0; a[1]=1; a[n_]:= a[n]= n(n+1)/2 -a[n-1] -a[n-2]; Table[a[n], {n,0,100}]
    f[n_] := Floor[(n + 1)(n + 2)/6]; Array[f, 59, 0] (* Or *)
    CoefficientList[ Series[ x/((1 + x + x^2)*(1 - x)^3), {x, 0, 58}], x] (* Robert G. Wilson v *)
    a[ n_] := With[{m = If[ n < 0, -3 - n, n]}, SeriesCoefficient[ x /((1 - x^3) (1 - x)^2), {x, 0, m}]]; (* Michael Somos, Jul 11 2011 *)
    LinearRecurrence[{2,-1,1,-2,1},{0,1,2,3,5},60] (* Harvey P. Dale, Jul 25 2011 *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n+4,{3}],#[[1]]<#[[2]]&&#[[1]]<#[[3]]&]],{n,0,15}] (* Gus Wiseman, Oct 05 2020 *)
  • PARI
    {a(n) = (n+1) * (n+2) \ 6}; /* Michael Somos, Feb 11 2004 */
    
  • Sage
    [binomial(n, 2) // 3 for n in range(2, 61)] # Zerinvary Lajos, Dec 01 2009
    

Formula

a(n) = (A000217(n+1) - A022003(n-1))/3;
a(n) = (A016754(n+1) - A010881(A016754(n+1)))/24;
a(n) = (A033996(n+1) - A010881(A033996(n+1)))/24.
Euler transform of length 3 sequence [2, 0, 1].
a(3*k-1) = k*(3*k + 1)/2;
a(3*k) = 3*k*(k + 1)/2;
a(3*k+1) = (k + 1)*(3*k + 2)/2.
a(n) = floor( (n+1)*(n+2)/6 ) = floor( A000217(n+1)/3 ).
a(n+1) = a(n) + A008620(n) = A002264(n+3). - Reinhard Zumkeller, Aug 01 2002
From Michael Somos, Feb 11 2004: (Start)
G.f.: x / ((1-x)^2 * (1-x^3)).
a(n) = 1 + a(n-1) + a(n-3) - a(n-4).
a(-3-n) = a(n). (End)
a(n) = a(n-3) + n for n > 2; a(0)=0, a(1)=1, a(2)=2. - Paul Barry, Jul 14 2004
a(n) = binomial(n+3, 3)/(n+3) + cos(2*Pi*(n-1)/3)/9 + sqrt(3)sin(2*Pi*(n-1)/3)/9 - 1/9. - Paul Barry, Jan 01 2005
From Paul Barry, Apr 16 2005: (Start)
a(n) = Sum_{k=0..n} k*(cos(2*Pi*(n-k)/3 + Pi/3)/3 + sqrt(3)*sin(2*Pi*(n-k)/3 + Pi/3)/3 + 1/3).
a(n) = Sum_{k=0..floor(n/3)} n-3*k. (End)
For n > 1, a(n) = A000217(n) - a(n-1) - a(n-2); a(0)=0, a(1)=1.
G.f.: x/(1 + x + x^2)/(1 - x)^3. - Maksym Voznyy (voznyy(AT)mail.ru), Jul 27 2009
a(n) = (4 + 3*n^2 + 9*n)/18 + ((n mod 3) - ((n-1) mod 3))/9. - Klaus Brockhaus, Oct 01 2009
a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5), with n>4, a(0)=0, a(1)=1, a(2)=2, a(3)=3, a(4)=5. - Harvey P. Dale, Jul 25 2011
a(n) = A214734(n + 2, 1, 3). - Renzo Benedetti, Aug 27 2012
G.f.: x*G(0), where G(k) = 1 + x*(3*k+4)/(3*k + 2 - 3*x*(k+2)*(3*k+2)/(3*(1+x)*k + 6*x + 4 - x*(3*k+4)*(3*k+5)/(x*(3*k+5) + 3*(k+1)/G(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Jun 10 2013
Empirical: a(n) = floor((n+3)/(e^(6/(n+3))-1)). - Richard R. Forberg, Jul 24 2013
a(n) = Sum_{i=0..n} floor((i+2)/3). - Bruno Berselli, Aug 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) = n/2 + floor(n^2/3 + 2/3)/2. - Bruno Berselli, Jan 23 2017
a(n) + a(n+1) = A000212(n+2). - R. J. Mathar, Jan 14 2021
Sum_{n>=1} 1/a(n) = 20/3 - 2*Pi/sqrt(3). - Amiram Eldar, Sep 27 2022
E.g.f.: (exp(x)*(4 + 12*x + 3*x^2) - 4*exp(-x/2)*cos(sqrt(3)*x/2))/18. - Stefano Spezia, Apr 05 2023

A006012 a(0) = 1, a(1) = 2, a(n) = 4*a(n-1) - 2*a(n-2), n >= 2.

Original entry on oeis.org

1, 2, 6, 20, 68, 232, 792, 2704, 9232, 31520, 107616, 367424, 1254464, 4283008, 14623104, 49926400, 170459392, 581984768, 1987020288, 6784111616, 23162405888, 79081400320, 270000789504, 921840357376, 3147359850496
Offset: 0

Views

Author

Keywords

Comments

Number of (s(0), s(1), ..., s(2n)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n, s(0) = 4, s(2n) = 4. - Herbert Kociemba, Jun 12 2004
a(n-1) counts permutations pi on [n] for which the pairs {i, pi(i)} with i < pi(i), considered as closed intervals [i+1,pi(i)], do not overlap; equivalently, for each i in [n] there is at most one j <= i with pi(j) > i. Counting these permutations by the position of n yields the recurrence relation. - David Callan, Sep 02 2003
a(n) is the sum of (n+1)-th row terms of triangle A140070. - Gary W. Adamson, May 04 2008
The binomial transform is in A083878, the Catalan transform in A084868. - R. J. Mathar, Nov 23 2008
Equals row sums of triangle A152252. - Gary W. Adamson, Nov 30 2008
Counts all paths of length (2*n), n >= 0, starting at the initial node on the path graph P_7, see the second Maple program. - Johannes W. Meijer, May 29 2010
From L. Edson Jeffery, Apr 04 2011: (Start)
Let U_1 and U_3 be the unit-primitive matrices (see [Jeffery])
U_1 = U_(8,1) = [(0,1,0,0); (1,0,1,0); (0,1,0,1); (0,0,2,0)] and
U_3 = U_(8,3) = [(0,0,0,1); (0,0,2,0); (0,2,0,1); (2,0,2,0)]. Then a(n) = (1/4) * Trace(U_1^(2*n)) = (1/2^(n+2)) * Trace(U_3^(2*n)). (See also A084130, A001333.) (End)
Pisano period lengths: 1, 1, 8, 1, 24, 8, 6, 1, 24, 24, 120, 8, 168, 6, 24, 1, 8, 24, 360, 24, ... - R. J. Mathar, Aug 10 2012
a(n) is the first superdiagonal of array A228405. - Richard R. Forberg, Sep 02 2013
Conjecture: With offset 1, a(n) is the number of permutations on [n] with no subsequence abcd such that (i) bc are adjacent in position and (ii) max(a,c) < min(b,d). For example, the 4 permutations of [4] not counted by a(4) are 1324, 1423, 2314, 2413. - David Callan, Aug 27 2014
The conjecture of David Callan above is correct - with offset 1, a(n) is the number of permutations on [n] with no subsequence abcd such that (i) bc are adjacent in position and (ii) max(a,c) < min(b,d). - Yonah Biers-Ariel, Jun 27 2017
From Gary W. Adamson, Jul 22 2016: (Start)
A production matrix for the sequence is M =
1, 1, 0, 0, 0, 0, ...
1, 0, 3, 0, 0, 0, ...
1, 0, 0, 3, 0, 0, ...
1, 0, 0, 0, 3, 0, ...
1, 0, 0, 0, 0, 3, ...
...
Take powers of M, extracting the upper left terms; getting the sequence starting: (1, 1, 2, 6, 20, 68, ...). (End)
From Gary W. Adamson, Jul 24 2016: (Start)
The sequence is the INVERT transform of the powers of 3 prefaced with a "1": (1, 1, 3, 9, 27, ...) and is N=3 in an infinite of analogous sequences starting:
N=1 (A000079): 1, 2, 4, 8, 16, 32, ...
N=2 (A001519): 1, 2, 5, 13, 34, 89, ...
N=3 (A006012): 1, 2, 6, 20, 68, 232, ...
N=4 (A052961): 1, 2, 7, 29, 124, 533, ...
N=5 (A154626): 1, 2, 8, 40, 208, 1088, ...
N=6: 1, 2, 9, 53, 326, 2017, ...
... (End)
Number of permutations of length n > 0 avoiding the partially ordered pattern (POP) {1>2, 1>3, 4>2, 4>3} of length 4. That is, number of length n permutations having no subsequences of length 4 in which the first and fourth elements are larger than the second and third elements. - Sergey Kitaev, Dec 08 2020
a(n-1) is the number of permutations of [n] that can be obtained by placing n points on an X-shape (two crossing lines with slopes 1 and -1), labeling them 1,2,...,n by increasing y-coordinate, and then reading the labels by increasing x-coordinate. - Sergi Elizalde, Sep 27 2021
Consider a stack of pancakes of height n, where the only allowed operation is reversing the top portion of the stack. First, perform a series of reversals of decreasing sizes, followed by a series of reversals of increasing sizes. The number of distinct permutations of the initial stack that can be reached through these operations is a(n). - Thomas Baruchel, May 12 2025
Number of permutations of [n] that are correctly sorted after performing one left-to-right pass and one right-to-left pass of the cocktail sort. - Thomas Baruchel, May 16 2025

References

  • D. H. Greene and D. E. Knuth, Mathematics for the Analysis of Algorithms. Birkhäuser, Boston, 3rd edition, 1990, p. 86.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, Sect 5.4.8 Answer to Exer. 8.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006012 n = a006012_list !! n
    a006012_list = 1 : 2 : zipWith (-) (tail $ map (* 4) a006012_list)
    (map (* 2) a006012_list)
    -- Reinhard Zumkeller, Oct 03 2011
    
  • Magma
    [n le 2 select n else 4*Self(n-1)- 2*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Apr 05 2011
    
  • Maple
    A006012:=-(-1+2*z)/(1-4*z+2*z**2); # Simon Plouffe in his 1992 dissertation
    with(GraphTheory): G:=PathGraph(7): A:= AdjacencyMatrix(G): nmax:=24; n2:=2*nmax: for n from 0 to n2 do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..7); od: seq(a(2*n),n=0..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    LinearRecurrence[{4,-2},{1,2},50] (* or *) With[{c=Sqrt[2]}, Simplify[ Table[((2+c)^n+(3+2c)(2-c)^n)/(2(2+c)),{n,50}]]] (* Harvey P. Dale, Aug 29 2011 *)
  • PARI
    {a(n) = real(((2 + quadgen(8))^n))}; /* Michael Somos, Feb 12 2004 */
    
  • PARI
    {a(n) = if( n<0, 2^n, 1) * polsym(x^2 - 4*x + 2, abs(n))[abs(n)+1] / 2}; /* Michael Somos, Feb 12 2004 */
    
  • PARI
    Vec((1-2*x)/(1-4*x+2*x^2) + O(x^100)) \\ Altug Alkan, Dec 05 2015
    
  • Python
    l = [1, 2]
    for n in range(2, 101): l.append(4 * l[n - 1] - 2 * l[n - 2])
    print(l)  # Indranil Ghosh, Jul 02 2017
    
  • SageMath
    A006012=BinaryRecurrenceSequence(4,-2,1,2)
    print([A006012(n) for n in range(41)]) # G. C. Greubel, Aug 27 2025

Formula

G.f.: (1-2*x)/(1 - 4*x + 2*x^2).
a(n) = 2*A007052(n-1) = A056236(n)/2.
Limit_{n -> oo} a(n)/a(n-1) = 2 + sqrt(2). - Zak Seidov, Oct 12 2002
From Paul Barry, May 08 2003: (Start)
Binomial transform of A001333.
E.g.f.: exp(2*x)*cosh(sqrt(2)*x). (End)
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2k)*2^(n-k) = Sum_{k=0..n} binomial(n, k)*2^(n-k/2)(1+(-1)^k)/2. - Paul Barry, Nov 22 2003 (typo corrected by Manfred Scheucher, Jan 17 2023)
a(n) = ((2+sqrt(2))^n + (2-sqrt(2))^n)/2.
a(n) = Sum_{k=0..n} 2^k*A098158(n,k). - Philippe Deléham, Dec 04 2006
a(n) = A007070(n) - 2*A007070(n-1). - R. J. Mathar, Nov 16 2007
a(n) = Sum_{k=0..n} A147703(n,k). - Philippe Deléham, Nov 29 2008
a(n) = Sum_{k=0..n} A201730(n,k). - Philippe Deléham, Dec 05 2011
G.f.: G(0) where G(k)= 1 + 2*x/((1-2*x) - 2*x*(1-2*x)/(2*x + (1-2*x)*2/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Dec 10 2012
G.f.: G(0)*(1-2*x)/2, where G(k) = 1 + 1/(1 - 2*x*(4*k+2-x)/( 2*x*(4*k+4-x) + 1/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 27 2014
a(-n) = a(n) / 2^n for all n in Z. - Michael Somos, Aug 24 2014
a(n) = A265185(n) / 4, connecting this sequence to the simple Lie algebra B_4. - Tom Copeland, Dec 04 2015
From G. C. Greubel, Aug 27 2025: (Start)
a(n) = 2^((n-2)/2)*( (n+1 mod 2)*A002203(n) + 2*sqrt(2)*(n mod 2)*A000129(n) ).
a(n) = 2^(n/2)*ChebyshevT(n, sqrt(2)). (End)

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

A003480 a(0) = 1, a(1) = 2, for n > 1, a(n) = 4*a(n-1) - 2*a(n-2).

Original entry on oeis.org

1, 2, 7, 24, 82, 280, 956, 3264, 11144, 38048, 129904, 443520, 1514272, 5170048, 17651648, 60266496, 205762688, 702517760, 2398545664, 8189147136, 27959497216, 95459694592, 325919783936, 1112759746560, 3799199418368, 12971278180352, 44286713884672, 151204299177984
Offset: 0

Views

Author

Keywords

Comments

Gives the number of L-convex polyominoes with n cells, that is convex polyominoes where any two cells can be connected by a path internal to the polyomino and which has at most 1 change of direction (i.e., one of the four orientation of the L). - Simone Rinaldi (rinaldi(AT)unisi.it), Feb 19 2007
Joe Keane (jgk(AT)jgk.org) observes that this sequence (beginning at 2) is "size of raises in pot-limit poker, one blind, maximum raising".
Dimensions of the graded components of the Hopf algebra of noncommutative multi-symmetric functions of level 2. For level r, the sequence would be the INVERT transform of binomial(n+r-1,n). - Jean-Yves Thibon (jyt(AT)univ-mlv.fr), Jun 26 2008
The sum of the numbers in the n-th row of the summatory Pascal triangle (A059576). - Ron R. King, Jan 22 2009
(1 + 2x + 7x^2 + 24x^3 + ...) = 1 / (1 - 2x - 3x^2 - 4x^3 - ...). - Gary W. Adamson, Jul 27 2009
Let M be a triangle with the odd-indexed Fibonacci numbers (1, 2, 5, 13, ...) in every column, with the leftmost column shifted upwards one row. A003480 = lim_{n->oo} M^n, the left-shifted vector considered as a sequence. The analogous operation using the even-indexed Fibonacci numbers generates A001835 starting with offset 1. - Gary W. Adamson, Jul 27 2010
a(n) is the number of generalized compositions of n when there are i+1 different types of the part i, (i=1,2,...). - Milan Janjic, Sep 24 2010
Let h(t) = (1-t)^2/(2*(1-t)^2-1) = 1/(1-(2*t + 3*t^2 + 4*t^3 + ...)),
an o.g.f. for A003480, then
A001003(n) = (1/n!)*((h(t)*d/dt)^n) t, evaluated at t=0, with initial n=1. - Tom Copeland, Sep 06 2011
Excluding the initial 1, a(n) is the 2nd subdiagonal of A228405. - Richard R. Forberg, Sep 02 2013

References

  • G. Castiglione and A. Restivo, L-convex polyominoes: a survey, Chapter 2 of K. G. Subranian et al., eds., Formal Models, Languages and Applications, World Scientific, 2015.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row sums of A059576 and of A181289. Second differences of A007070.
Column k=2 of A261780.

Programs

  • Haskell
    a003480 n = a003480_list !! n
    a003480_list = 1 : 2 : 7 : (tail $ zipWith (-)
       (tail $ map (* 4) a003480_list) (map (* 2) a003480_list))
    -- Reinhard Zumkeller, Jan 16 2012, Oct 03 2011
  • Maple
    INVERT([seq(n+1,n=1..20)]); # Jean-Yves Thibon (jyt(AT)univ-mlv.fr), Jun 26 2008
  • Mathematica
    a[0]=1; a[1]=2; a[2]=7; a[n_]:=a[n]=4*a[n-1] - 2*a[n-2]; Table[a[n],{n,0,24}] (* Jean-François Alcover, Mar 22 2011 *)
    Join[{1},LinearRecurrence[{4,-2},{2,7},40]] (* Harvey P. Dale, Oct 23 2011 *)
  • PARI
    a(n)=polcoeff((1-x)^2/(1-4*x+2*x^2)+x*O(x^n),n)
    
  • PARI
    a(n)=local(x); if(n<1,n==0,x=(2+quadgen(8))^n; imag(x)+real(x)/2)
    

Formula

a(n) = (n+1)*a(0) + n*a(1) + ... + 3*a(n-2) + 2*a(n-1). - Amarnath Murthy, Aug 17 2002
G.f.: (1-x)^2/(1-4*x+2*x^2). - Simon Plouffe in his 1992 dissertation
a(n) = A007070(n)/2, n > 0.
G.f.: 1/( 1 - Sum_{k>=1} (k+1)*x^k ).
a(n+1)*a(n+1) - a(n+2)*a(n) = 2^n, n > 0. - D. G. Rogers, Jul 12 2004
For n > 0, a(n) = ((2+sqrt(2))^(n+1) - (2-sqrt(2))^(n+1))/(4*sqrt(2)). - Rolf Pleisch, Aug 03 2009
If the leading 1 is removed, 2, 7, 24, ... is the binomial transform of 2, 5, 12, 29, ..., which is A000129 without its first 2 terms, and the second binomial transform of 2, 3, 4, 6, ..., which is A029744, again without its leading 1. - Al Hakanson (hawkuu(AT)gmail.com), Aug 08 2009
a(n) = Sum((1+p_1)*(1+p_2)*...*(1+p_m)), summation being over all compositions (p_1, p_2, ..., p_m) of n. Example: a(3)=24; indeed, the compositions of 3 are (1,1,1), (1,2), (2,1), (3) and we have 2*2*2 + 2*3 + 3*2 + 4 = 24. - Emeric Deutsch, Oct 17 2010
a(n) = Sum_{k>=0} binomial(n+2*k-1,n) / 2^(k+1). - Vaclav Kotesovec, Dec 31 2013
E.g.f.: (1 + exp(2*x)*(cosh(sqrt(2)*x) + sqrt(2)*sinh(sqrt(2)*x)))/2. - Stefano Spezia, May 20 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

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
Showing 1-10 of 88 results. Next