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 12 results. Next

A056243 Third diagonal of triangle A056242.

Original entry on oeis.org

1, 9, 41, 146, 456, 1312, 3568, 9312, 23552, 58112, 140544, 334336, 784384, 1818624, 4173824, 9494528, 21430272, 48037888, 107020288, 237109248, 522715136, 1147142144, 2507145216, 5458886656, 11844714496, 25618808832, 55247372288
Offset: 3

Views

Author

Colin Mallows, Aug 23 2000

Keywords

Crossrefs

Cf. A056242.

Programs

  • Maple
    seq(add((-1)^(n-3-j)*binomial(n-3,j)*binomial(n+2*j-1,2*j),j=0..n-3),n=3..40); # Pab Ter (pabrlos2(AT)yahoo.com), Nov 06 2005
    T:=proc(n,k) local j: if k=1 then 1 elif k<=n then add((-1)^(k-1-j)*binomial(k-1,j)*binomial(n+2*j-1,2*j),j=0..k-1) else 0 fi end: seq(T(n,n-2),n=3..40); # Pab Ter (pabrlos2(AT)yahoo.com), Nov 06 2005

Formula

a(n) = Sum_{0<=j<=n-3} (-1)^(n-3-j)*binomial(n-3, j)*binomial(n+2j-1, 2j), for n>=3. - Pab Ter (pabrlos2(AT)yahoo.com), Nov 06 2005
Conjecture: a(n) = 2^(-6+n)*(32-35*n+9*n^2). G.f.: x^3*(1+3*x-x^2)/(1-2*x)^3. - Colin Barker, Mar 20 2012

Extensions

More terms from Pab Ter (pabrlos2(AT)yahoo.com), Nov 06 2005

A007052 Number of order-consecutive partitions of n.

Original entry on oeis.org

1, 3, 10, 34, 116, 396, 1352, 4616, 15760, 53808, 183712, 627232, 2141504, 7311552, 24963200, 85229696, 290992384, 993510144, 3392055808, 11581202944, 39540700160, 135000394752, 460920178688, 1573679925248, 5372879343616, 18344157523968, 62630871408640, 213835170586624
Offset: 0

Views

Author

Colin Mallows, N. J. A. Sloane, and Simon Plouffe

Keywords

Comments

After initial terms, first differs from A291292 at a(6) = 1352, A291292(8) = 1353.
Joe Keane (jgk(AT)jgk.org) observes that this sequence (beginning at 3) is "size of raises in pot-limit poker, one blind, maximum raising".
It appears that this sequence is the BinomialMean transform of A001653 (see A075271). - John W. Layman, Oct 03 2002
Number of (s(0), s(1), ..., s(2n+1)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n+1, s(0) = 3, s(2n+1) = 4. - Herbert Kociemba, Jun 12 2004
Equals the INVERT transform of (1, 2, 5, 13, 34, 89, ...). - Gary W. Adamson, May 01 2009
a(n) is the number of compositions of n when there are 3 types of ones. - Milan Janjic, Aug 13 2010
a(n)/a(n-1) tends to (4 + sqrt(8))/2 = 3.414213.... Gary W. Adamson, Jul 30 2013
a(n) is the first subdiagonal of array A228405. - Richard R. Forberg, Sep 02 2013
Number of words of length n over {0,1,2,3,4} in which binary subwords appear in the form 10...0. - Milan Janjic, Jan 25 2017
From Gus Wiseman, Mar 05 2020: (Start)
Also the number of unimodal sequences of length n + 1 covering an initial interval of positive integers, where a sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence. For example, the a(0) = 1 through a(2) = 10 sequences are:
(1) (1,1) (1,1,1)
(1,2) (1,1,2)
(2,1) (1,2,1)
(1,2,2)
(1,2,3)
(1,3,2)
(2,1,1)
(2,2,1)
(2,3,1)
(3,2,1)
Missing are: (2,1,2), (2,1,3), (3,1,2).
Conjecture: Also the number of ordered set partitions of {1..n + 1} where no element of any block is greater than any element of a non-adjacent consecutive block. For example, the a(0) = 1 through a(2) = 10 ordered set partitions are:
{{1}} {{1,2}} {{1,2,3}}
{{1},{2}} {{1},{2,3}}
{{2},{1}} {{1,2},{3}}
{{1,3},{2}}
{{2},{1,3}}
{{2,3},{1}}
{{3},{1,2}}
{{1},{2},{3}}
{{1},{3},{2}}
{{2},{1},{3}}
a(n-1) is the number of hexagonal directed-column convex polyominoes having area n (see Baril et al. at page 4). - Stefano Spezia, Oct 14 2023

Examples

			G.f. = 1 + 3*x + 10*x^2 + 34*x^3 + 116*x^4 + 396*x^5 + 1352*x^6 + 4616*x^7 + ...
		

References

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

Crossrefs

Programs

  • Magma
    [Floor((2+Sqrt(2))^n*(1/2+Sqrt(2)/4)+(2-Sqrt(2))^n*(1/2-Sqrt(2)/4)): n in [0..30] ] ; // Vincenzo Librandi, Aug 20 2011
  • Mathematica
    a[n_]:=(MatrixPower[{{3,1},{1,1}},n].{{2},{1}})[[2,1]]; Table[a[n],{n,0,40}] (* Vladimir Joseph Stephan Orlovsky, Feb 20 2010 *)
    a[ n_] := ((2 + Sqrt[2])^(n + 1) + (2 - Sqrt[2])^(n + 1)) / 4 // Simplify; (* Michael Somos, Jan 25 2017 *)
    LinearRecurrence[{4, -2}, {1, 3}, 24] (* Jean-François Alcover, Jan 07 2019 *)
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Union@@Permutations/@allnorm[n],unimodQ]],{n,6}] (* Gus Wiseman, Mar 06 2020 *)
  • PARI
    {a(n) = real((2 + quadgen(8))^(n+1)) / 2}; /* Michael Somos, Mar 06 2003 */
    

Formula

a(n+1) = 4*a(n) - 2*a(n-1).
G.f.: (1-x)/(1-4*x+2*x^2).
Binomial transform of Pell numbers 1, 2, 5, 12, ... (A000129).
a(n) = A006012(n+1)/2 = A056236(n+1)/4. - Michael Somos, Mar 06 2003
a(n) = (A035344(n)+1)/2; a(n) = (2+sqrt(2))^n(1/2+sqrt(2)/4)+(2-sqrt(2))^n(1/2-sqrt(2)/4). - Paul Barry, Jul 16 2003
Second binomial transform of (1, 1, 2, 2, 4, 4, ...). a(n) = Sum_{k=1..floor(n/2)}, C(n, 2k)*2^(n-k-1). - Paul Barry, Nov 22 2003
a(n) = ( (2-sqrt(2))^(n+1) + (2+sqrt(2))^(n+1) )/4. - Herbert Kociemba, Jun 12 2004
a(n) = both left and right terms 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] = [a(n) A007070(n) a(n)]. E.g., a(3) = 34. M^3 * [1 1 1] = [34 48 34] (center term is A007070(3)). - Gary W. Adamson, Dec 18 2004
The i-th term of the sequence is the entry (2, 2) in the i-th power of the 2 X 2 matrix M = ((1, 1), (1, 3)). - Simone Severini, Oct 15 2005
E.g.f.: exp(2*x)*(cosh(sqrt(2)*x)+sinh(sqrt(2)*x)/sqrt(2)). - Paul Barry, Nov 20 2003
a(n) = A007068(2*n), n>0. - R. J. Mathar, Aug 17 2009
If p[i]=Fibonacci(2i-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-1) = Sum_{k=-floor(n/4)..floor(n/4)} (-1)^k*binomial(2*n,n+4*k)/2. - Mircea Merca, Jan 28 2012
G.f.: G(0)*(1-x)/(2*x) + 1 - 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) = 3*a(n-1) + a(n-2) + a(n-3) + a(n-4) + ... + a(0). - Gary W. Adamson, Aug 12 2013
a(n) = a(-2-n) * 2^(n+1) for all n in Z. - Michael Somos, Jan 25 2017

A077998 Expansion of (1-x)/(1-2*x-x^2+x^3).

Original entry on oeis.org

1, 1, 3, 6, 14, 31, 70, 157, 353, 793, 1782, 4004, 8997, 20216, 45425, 102069, 229347, 515338, 1157954, 2601899, 5846414, 13136773, 29518061, 66326481, 149034250, 334876920, 752461609, 1690765888, 3799116465, 8536537209, 19181424995, 43100270734, 96845429254
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Let u(k), v(k), w(k) be defined by u(1)=1, v(1)=0, w(1)=0 and u(k+1)=u(k)+v(k)+w(k), v(k+1)=u(k)+v(k), w(k+1)=u(k); then {u(n)} = 1,1,3,6,14,31,... (A006356 with an extra initial 1), {v(n)} = 0,1,2,5,11,25,... (A006054 with its initial 0 deleted) and {w(n)} = {u(n)} prefixed by an extra 0 = this sequence with an extra initial 0. - Benoit Cloitre, Apr 05 2002 [Also u(k)^2+v(k)^2+w(k)^2 = u(2k). - Gary W. Adamson, Dec 23 2003]
Form the graph with matrix A=[1, 1, 1; 1, 0, 0; 1, 0, 1]. Then A077998 counts closed walks of length n at the vertex of degree 4. - Paul Barry, Oct 02 2004
a(n) is the number of Motzkin (n+2)-sequences with no flatsteps at ground level and whose height is <=2. For example, a(3)=6 counts UDUFD, UFDUD, UFFFD, UFUDD, UUDFD, UUFDD. - David Callan, Dec 09 2004
Number of compositions of n if there are two kinds of part 2. Example: a(3)=6 because we have (3),(1,2),(1,2'),(2,1),(2',1) and (1,1,1). Row sums of A105477. - Emeric Deutsch, Apr 09 2005
Diagonal sums of A056242. - Paul Barry, Dec 26 2007
Diagonal sums of triangle in A105306. - Philippe Deléham, Nov 16 2008
a(n) appears in the formula for the nonpositive powers of rho:= 2*cos(Pi/7), the ratio of the smaller diagonal in the heptagon to the side length s=2*sin(Pi/7), when expressed in the basis <1,rho,sigma>, with sigma:=rho^2-1, the ratio of the larger heptagon diagonal to the side length, as follows. rho^(-n) = a(n)*1 + a(n-1)*rho - C(n)*sigma, n>=0, with C(n)=A006054(n+1). Put a(-1):=0. See the Steinbach reference, and a comment under A052547.
The limit a(n+1)/a(n) for n -> infinity is sigma = rho^2-1, approximately 2.246979603. See a Nov 07 2013 comment on A006054 for the proof, and the preceding comment for rho and sigma and the P. Steinbach reference. - Wolfdieter Lang, Nov 07 2013
From Greg Dresden and Aaron Zhou, Jun 15 2023: (Start)
a(n) is the number of ways to tile a skew double-strip of 3*n cells using all possible "trominos". Here is the skew double-strip corresponding to n=4, with 12 cells:
_ ___ _ ___ _ ___
| | | | | | |
|__|___|_|___| |___|
| | | | | | |
|_|___|_|___|_|___|,
and here are the three possible "tromino" tiles, which can be rotated or reflected as needed:
_ _
| | | |
|__|_ ___|___| _________
| | | | | | | | | |
|_|___|, |_|___| , |_|___|_|.
As an example, here is one of the a(4) = 14 ways to tile the skew double-strip of 12 cells:
_ ___ _____ _______
| | | | |
| | |___ | |
| | | | |
|_____|_______|_|___|. (End)

Examples

			G.f. = 1 + x + 3*x^2 + 6*x^3 + 14*x^4 + 31*x^5 + 70*x^6 + 157*x^7 + 353*x^8 + ... - _Michael Somos_, Dec 12 2023
		

References

  • Kenneth Edwards, Michael A. Allen, A new combinatorial interpretation of the Fibonacci numbers squared, Part II, Fib. Q., 58:2 (2020), 169-177.
  • Jay Kappraff, Beyond Measure, A Guided Tour Through Nature, Myth and Number, World Scientific, 2002.

Crossrefs

Apart from initial term, same as A006356, which is the main entry for this sequence. A106803 is yet another version.

Programs

  • GAP
    a:=[1,1,3];; for n in [4..40] do a[n]:=2*a[n-1]+a[n-2]-a[n-3]; od; a; # G. C. Greubel, Jun 27 2019
  • Magma
    I:=[1,1,3]; [n le 3 select I[n] else 2*Self(n-1)+Self(n-2)-Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jun 01 2017
    
  • Mathematica
    CoefficientList[Series[(1-x)/(1-2*x-x^2+x^3), {x, 0, 40}], x] (* Stefan Steinerberger, Sep 11 2006 *)
    LinearRecurrence[{2,1,-1},{1,1,3},40] (* Roman Witula, Aug 07 2012 *)
    a[ n_] := {1, 0, 0} . MatrixPower[{{0, 1, 0}, {0, 0, 1}, {-1, 1, 2}}, n] . {1, 1, 3}; (* Michael Somos, Dec 12 2023 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -1,1,2]^n*[1;1;3])[1,1] \\ Charles R Greathouse IV, May 10 2016
    
  • SageMath
    ((1-x)/(1-2*x-x^2+x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jun 27 2019
    

Formula

a(0)=a(1)=1, a(2)=3, a(n+1) = 2*a(n) + a(n-1) - a(n-2) for n>=2. - Philippe Deléham, Sep 07 2006
7*a(n) = (s(2))^2*(1+c(1))^n + (s(4))^2*(1+c(2))^n + (s(1))^2(1+c(4))^n, where c(j) = 2*Cos(2Pi*j/7) and s(j) = 2*Sin(2Pi*j/7) - for the proof of this one and many other relations for the sequences u(k), v(k) and w(k) defined on the top of the comments by Benoit Cloitre - see Witula et al.'s paper. - Roman Witula, Aug 07 2012
a(n) = b(n+2)- b(n+1), first differences of b(n) = A006054(n). - Wolfdieter Lang, Nov 07 2013; corrected by Kai Wang, May 31 2017
a(n) = A096976(-n) for all n in Z. - Michael Somos, Dec 12 2023

Extensions

Edited by N. J. A. Sloane, Aug 08 2008 at the suggestion of R. J. Mathar

A053220 a(n) = (3*n-1) * 2^(n-2).

Original entry on oeis.org

1, 5, 16, 44, 112, 272, 640, 1472, 3328, 7424, 16384, 35840, 77824, 167936, 360448, 770048, 1638400, 3473408, 7340032, 15466496, 32505856, 68157440, 142606336, 297795584, 620756992, 1291845632, 2684354560, 5570035712, 11542724608, 23890755584, 49392123904
Offset: 1

Views

Author

Asher Auel, Jan 01 2000

Keywords

Comments

Coefficients in the hypergeometric series identity 1 - 5*x/(x + 4) + 16*x*(x - 1)/((x + 4)*(x + 6)) - 44*x*(x - 1)*(x - 2)/((x + 4)*(x + 6)*(x + 8)) + ... = 0, valid in the half-plane Re(x) > 0. Cf. A276289. - Peter Bala, May 30 2019
For n>=2, a(n) is the total number of ones in runs of ones of length >=5 over all binary strings of length n+3. - Félix Balado, Aug 06 2025

Crossrefs

Center elements from triangle A053218. Also a diagonal of triangle A056242.

Programs

  • Haskell
    a053220 n = a056242 (n + 1) n  -- Reinhard Zumkeller, May 08 2014
  • Magma
    [(3*n-1)*2^(n-2): n in [1..50]]; // Vincenzo Librandi, May 09 2011
    
  • Mathematica
    ListCorrelate[{1, 1}, Table[n 2^(n - 1), {n, 0, 28}]] (* or *) ListConvolve[{1, 1}, Table[n 2^(n - 1), {n, 0, 28}]] (* Ross La Haye, Feb 24 2007 *)
    LinearRecurrence[{4, -4}, {1, 5}, 35] (* Vladimir Joseph Stephan Orlovsky, Jan 29 2012 *)
    Array[(3# - 1) 2^(# - 2) &, 35] (* Alonso del Arte, Sep 04 2018 *)
    CoefficientList[Series[(1 + x)/(1 - 2 * x)^2, {x, 0, 50}], x] (* Stefano Spezia, Sep 04 2018 *)
  • PARI
    a(n)=if(n<1,0,(3*n-1)*2^(n-2))
    
  • PARI
    a(n)=(3*n-1)<<(n-2) \\ Charles R Greathouse IV, Apr 17 2012
    

Formula

G.f.: x*(1+x)/(1-2*x)^2.
a(n) = (3*n-1) * 2^(n-2).
E.g.f.: exp(2*x)*(1+3*x). The sequence 0, 1, 5, 16, ... has a(n) = ((3n-1)*2^n + 0^n)/4 (offset 0). It is the binomial transform of A032766. The sequence 1, 5, 16, ... has a(n) = (2+3n)*2^(n-1) (offset 0). It is the binomial transform of A016777. - Paul Barry, Jul 23 2003
Row sums of A132776(n-1). - Gary W. Adamson, Aug 29 2007

A332872 Number of ordered set partitions of {1..n} where no element of any block is greater than any element of a non-adjacent consecutive block.

Original entry on oeis.org

1, 1, 3, 10, 34, 116, 396, 1352, 4616, 15760
Offset: 0

Views

Author

Gus Wiseman, Mar 06 2020

Keywords

Comments

After initial terms, first differs from A291292 at a(7) = 1352, A291292(8) = 1353.
Conjectured to be the same as A007052, shifted right once.

Examples

			The a(1) = 1 through a(3) = 10 ordered set partitions:
  {{1}}  {{1,2}}    {{1,2,3}}
         {{1},{2}}  {{1},{2,3}}
         {{2},{1}}  {{1,2},{3}}
                    {{1,3},{2}}
                    {{2},{1,3}}
                    {{2,3},{1}}
                    {{3},{1,2}}
                    {{1},{2},{3}}
                    {{1},{3},{2}}
                    {{2},{1},{3}}
		

Crossrefs

Row sums of A332673.
Set partitions are A000110.
Ordered set-partitions are A000670.
Unimodal sequences covering an initial interval are A007052.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[Join@@Permutations/@sps[Range[n]],!MatchQ[#,{_,{_,a_,_},,{_,b_,_},_}/;a>b]&]],{n,0,5}]

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

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 8, 10, 13, 18, 26, 31, 42, 52, 68, 89, 110, 136, 173, 212, 262, 330, 398, 487, 592, 720, 864, 1050, 1262, 1508, 1804, 2152, 2550, 3037, 3584, 4236, 5011, 5880, 6901, 8095, 9472, 11048, 12899, 14996, 17436, 20261, 23460, 27128, 31385, 36189
Offset: 0

Views

Author

Gus Wiseman, May 16 2020

Keywords

Comments

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

Examples

			The a(1) = 1 through a(8) = 13 compositions:
  (1)  (2)  (3)    (4)    (5)    (6)      (7)      (8)
            (1,2)  (1,3)  (1,4)  (1,5)    (1,6)    (1,7)
            (2,1)  (3,1)  (2,3)  (2,4)    (2,5)    (2,6)
                          (3,2)  (4,2)    (3,4)    (3,5)
                          (4,1)  (5,1)    (4,3)    (5,3)
                                 (2,3,1)  (5,2)    (6,2)
                                 (3,1,2)  (6,1)    (7,1)
                                 (3,2,1)  (2,4,1)  (2,5,1)
                                          (4,1,2)  (3,4,1)
                                          (4,2,1)  (4,1,3)
                                                   (4,3,1)
                                                   (5,1,2)
                                                   (5,2,1)
For example, (3,5,1,2) is such a composition, because the non-adjacent pairs of parts are (3,1), (3,2), (5,2), all of which are strictly decreasing.
		

Crossrefs

The case of permutations appears to be A000045(n + 1).
Unimodal strict compositions are A072706.
A version for ordered set partitions is A332872.
The non-strict version is A333148.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@#&&!MatchQ[#,{_,x_,,y_,_}/;y>x]&]],{n,0,10}]
  • PARI
    seq(n)={my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); Vec(sum(k=0, n, fibonacci(k+1) * polcoef(p,k,y)))} \\ Andrew Howroyd, Apr 16 2021

Formula

G.f.: Sum_{k>=0} Fibonacci(k+1) * [y^k](Product_{j>=1} 1 + y*x^j). - Andrew Howroyd, Apr 16 2021

A117317 Triangle related to partitions of n.

Original entry on oeis.org

1, 2, 1, 4, 5, 1, 8, 16, 9, 1, 16, 44, 41, 14, 1, 32, 112, 146, 85, 20, 1, 64, 272, 456, 377, 155, 27, 1, 128, 640, 1312, 1408, 833, 259, 35, 1, 256, 1472, 3568, 4712, 3649, 1652, 406, 44, 1, 512, 3328, 9312, 14608, 14002, 8361, 3024, 606, 54, 1, 1024, 7424, 23552
Offset: 0

Views

Author

Paul Barry, Mar 07 2006

Keywords

Comments

Row sums are A007052. Diagonal sums are A052988. Reversal of A056242.
Essentially given by (0, 2, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (1, 0, 1/2, 1/2, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938. - Philippe Deléham, Jan 28 2012

Examples

			Triangle begins
1,
2, 1,
4, 5, 1,
8, 16, 9, 1,
16, 44, 41, 14, 1,
32, 112, 146, 85, 20, 1,
64, 272, 456, 377, 155, 27, 1
Triangle (0, 2, 0, 0, 0, 0, ...) DELTA (1, 0, 1/2, 1/2, 0, 0, ...) begins :
1
0, 1
0, 2, 1
0, 4, 5, 1
0, 8, 16, 9, 1
0, 16, 44, 41, 14, 1
0, 32, 112, 146, 85, 20, 1
0, 64, 272, 456, 377, 155, 27, 1
		

Crossrefs

Cf. Columns : A000079, A053220, A056243 ; Diagonals : A000012, A000096

Programs

  • Haskell
    a117317 n k = a117317_tabl !! n !! k
    a117317_row n = a117317_tabl !! n
    a117317_tabl = map reverse a056242_tabl
    -- Reinhard Zumkeller, May 08 2014

Formula

Number triangle T(n,k)=sum{j=0..n-k, C(n+j,k)C(n-k,j)}
T(n,k) = 2*T(n-1,k) + 2*T(n-1,k-1) - T(n-2,k-1) - T(n-2,k-2) for n>1. - Philippe Deléham, Jan 28 2012
G.f.: (1-y*x)/(1-2*(y+1)*x+y*(y+1)*x^2). - Philippe Deléham, Jan 28 2012

A332673 Triangle read by rows where T(n,k) is the number of length-k ordered set partitions of {1..n} whose non-adjacent blocks are pairwise increasing.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 1, 6, 3, 0, 1, 14, 14, 5, 0, 1, 30, 45, 32, 8, 0, 1, 62, 124, 131, 65, 13, 0, 1, 126, 315, 438, 323, 128, 21, 0, 1, 254, 762, 1305, 1270, 747, 243, 34, 0, 1, 510, 1785, 3612, 4346, 3370, 1629, 452, 55
Offset: 0

Views

Author

Gus Wiseman, Mar 02 2020

Keywords

Comments

In other words, parts of subsequent, non-successive blocks are increasing.

Examples

			Triangle begins:
    1
    0    1
    0    1    2
    0    1    6    3
    0    1   14   14    5
    0    1   30   45   32    8
    0    1   62  124  131   65   13
    0    1  126  315  438  323  128   21
    0    1  254  762 1305 1270  747  243   34
    ...
Row n = 4 counts the following ordered set partitions:
  {1234}  {1}{234}  {1}{2}{34}  {1}{2}{3}{4}
          {12}{34}  {1}{23}{4}  {1}{2}{4}{3}
          {123}{4}  {12}{3}{4}  {1}{3}{2}{4}
          {124}{3}  {1}{24}{3}  {2}{1}{3}{4}
          {13}{24}  {12}{4}{3}  {2}{1}{4}{3}
          {134}{2}  {1}{3}{24}
          {14}{23}  {13}{2}{4}
          {2}{134}  {1}{34}{2}
          {23}{14}  {1}{4}{23}
          {234}{1}  {2}{1}{34}
          {24}{13}  {2}{13}{4}
          {3}{124}  {2}{14}{3}
          {34}{12}  {23}{1}{4}
          {4}{123}  {3}{12}{4}
		

Crossrefs

An apparently related triangle is A056242.
Column k = n - 1 is A332724.
Row sums are A332872, which appears to be A007052 shifted right once.
Ordered set-partitions are A000670.
Unimodal compositions are A001523.
Non-unimodal normal sequences are A328509.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[Join@@Permutations/@sps[Range[n]],Length[#]==k&&!MatchQ[#,{_,{_,a_,_},,{_,b_,_},_}/;a>b]&]],{n,0,5},{k,0,n}]

A332724 Number of length n - 1 ordered set partitions of {1..n} where no element of any block is greater than any element of a non-adjacent consecutive block.

Original entry on oeis.org

0, 0, 1, 6, 14, 32, 65, 128, 243, 452, 826, 1490, 2659, 4704, 8261, 14418, 25030, 43252, 74437, 127648, 218199, 371920, 632306, 1072486, 1815239, 3066432, 5170825, 8705118, 14632958, 24562952, 41177801, 68947520, 115313979, 192656924, 321554986, 536191418
Offset: 0

Views

Author

Gus Wiseman, Mar 03 2020

Keywords

Comments

In other words, parts of not-immediately-subsequent blocks are increasing.

Examples

			The a(2) = 1 through a(4) = 14 ordered set partitions:
  {{1,2}}  {{1},{2,3}}  {{1},{2},{3,4}}
           {{1,2},{3}}  {{1},{2,3},{4}}
           {{1,3},{2}}  {{1,2},{3},{4}}
           {{2},{1,3}}  {{1},{2,4},{3}}
           {{2,3},{1}}  {{1,2},{4},{3}}
           {{3},{1,2}}  {{1},{3},{2,4}}
                        {{1,3},{2},{4}}
                        {{1},{3,4},{2}}
                        {{1},{4},{2,3}}
                        {{2},{1},{3,4}}
                        {{2},{1,3},{4}}
                        {{2},{1,4},{3}}
                        {{2,3},{1},{4}}
                        {{3},{1,2},{4}}
		

Crossrefs

Column k = n - 1 of A332673, which has row-sums A332872.
Ordered set-partitions are A000670.
Unimodal compositions are A001523.
Unimodal normal sequences appear to be A007052.
Non-unimodal normal sequences are A328509.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[Join@@Permutations/@sps[Range[n]],Length[#]==n-1&&!MatchQ[#,{_,{_,a_,_},,{_,b_,_},_}/;a>b]&]],{n,0,8}]
  • PARI
    \\ here b(n) is A001629(n).
    b(n) = {((n+1)*fibonacci(n-1) + (n-1)*fibonacci(n+1))/5}
    a(n) = {if(n==0, 0, b(n) + 4*b(n-1) + b(n-2))} \\ Andrew Howroyd, Apr 17 2021

Formula

From Andrew Howroyd, Apr 17 2021: (Start)
a(n) = A001629(n) + 4*A001629(n+1) + A001629(n+2) for n > 0.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) - a(n-4) for n > 4.
G.f.: x*(1 + 4*x + x^2)/(1 - x - x^2)^2.
(End)

Extensions

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

A333148 Number of compositions of n whose non-adjacent parts are weakly decreasing.

Original entry on oeis.org

1, 1, 2, 4, 7, 12, 19, 30, 46, 69, 102, 149, 214, 304, 428, 596, 823, 1127, 1532, 2068, 2774, 3697, 4900, 6460, 8474, 11061, 14375, 18600, 23970, 30770, 39354, 50153, 63702, 80646, 101783, 128076, 160701, 201076, 250933, 312346, 387832, 480409, 593716, 732105, 900810, 1106063, 1355336, 1657517, 2023207, 2464987, 2997834, 3639464
Offset: 0

Views

Author

Gus Wiseman, May 16 2020

Keywords

Examples

			The a(1) = 1 through a(6) = 19 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (12)   (13)    (14)     (15)
             (21)   (22)    (23)     (24)
             (111)  (31)    (32)     (33)
                    (121)   (41)     (42)
                    (211)   (131)    (51)
                    (1111)  (212)    (141)
                            (221)    (222)
                            (311)    (231)
                            (1211)   (312)
                            (2111)   (321)
                            (11111)  (411)
                                     (1311)
                                     (2121)
                                     (2211)
                                     (3111)
                                     (12111)
                                     (21111)
                                     (111111)
For example, (2,3,1,2) is such a composition, because the non-adjacent pairs of parts are (2,1), (2,2), (3,2), all of which are weakly decreasing.
		

Crossrefs

Unimodal compositions are A001523.
The case of normal sequences appears to be A028859.
A version for ordered set partitions is A332872.
The case of strict compositions is A333150.
The version for strictly decreasing parts is A333193.
Standard composition numbers (A066099) of these compositions are A334966.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,,y_,_}/;y>x]&]],{n,0,15}]
  • Sage
    def a333148(n): return number_of_partitions(n) + sum( Partitions(m, max_part=l, length=k).cardinality() * Partitions(n-m-l^2, min_length=k+2*l).cardinality() for l in range(1, (n+1).isqrt()) for m in range((n-l^2-2*l)*l//(l+1)+1) for k in range(ceil(m/l), min(m,n-m-l^2-2*l)+1) ) # Max Alekseyev, Oct 31 2024

Formula

See Sage code for the formula. - Max Alekseyev, Oct 31 2024

Extensions

Edited and terms a(21)-a(51) added by Max Alekseyev, Oct 30 2024
Showing 1-10 of 12 results. Next