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.

Previous Showing 21-30 of 38 results. Next

A229372 T(n,k)=Number of nXk 0..2 arrays avoiding 11 horizontally, 22 vertically and 00 antidiagonally.

Original entry on oeis.org

3, 8, 8, 22, 38, 22, 60, 184, 184, 60, 164, 869, 1610, 869, 164, 448, 4144, 13937, 13937, 4144, 448, 1224, 19675, 122497, 222990, 122497, 19675, 1224, 3344, 93589, 1067299, 3576912, 3576912, 1067299, 93589, 3344, 9136, 444824, 9346997, 56939585
Offset: 1

Views

Author

R. H. Hardin Sep 21 2013

Keywords

Comments

Table starts
....3......8.......22..........60...........164.............448
....8.....38......184.........869..........4144...........19675
...22....184.....1610.......13937........122497.........1067299
...60....869....13937......222990.......3576912........56939585
..164...4144...122497.....3576912.....104382552......3043629267
..448..19675..1067299....56939585....3043629267....162794962814
.1224..93589..9346997...911301584...89084628843...8710922742428
.3344.444824.81633583.14532090528.2599351293506.465220677212678

Examples

			Some solutions for n=3 k=4
..2..1..2..2....1..2..0..2....0..1..0..0....1..0..2..1....0..1..0..1
..0..2..1..0....0..1..2..1....1..2..2..2....2..1..0..0....2..1..0..2
..2..0..1..2....2..1..0..1....0..0..0..1....1..2..1..2....1..2..2..1
		

Crossrefs

Column 1 is A028859

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) +2*a(n-2)
k=2: a(n) = 2*a(n-1) +13*a(n-2) +3*a(n-3) -13*a(n-4) +4*a(n-5)
k=3: [order 11]
k=4: [order 24] for n>25
k=5: [order 50] for n>54

A229380 T(n,k)=Number of nXk 0..2 arrays avoiding 11 horizontally, 22 vertically and 00 diagonally or antidiagonally.

Original entry on oeis.org

3, 8, 8, 22, 30, 22, 60, 126, 126, 60, 164, 518, 956, 518, 164, 448, 2138, 6730, 6730, 2138, 448, 1224, 8818, 48490, 78690, 48490, 8818, 1224, 3344, 36374, 346598, 956866, 956866, 346598, 36374, 3344, 9136, 150038, 2486980, 11441370, 20014278, 11441370
Offset: 1

Views

Author

R. H. Hardin Sep 21 2013

Keywords

Comments

Table starts
....3......8.......22.........60..........164............448.............1224
....8.....30......126........518.........2138...........8818............36374
...22....126......956.......6730........48490.........346598..........2486980
...60....518.....6730......78690.......956866.......11441370........138118032
..164...2138....48490.....956866.....20014278......407900408.......8454015792
..448...8818...346598...11441370....407900408....13999334726.....492938029980
.1224..36374..2486980..138118032...8454015792...492938029980...29757371834046
.3344.150038.17808604.1657198220.173331549156.17047266083040.1753378119210848

Examples

			Some solutions for n=3 k=4
..1..0..1..2....1..0..2..1....0..2..0..1....2..0..1..2....2..0..1..2
..1..2..1..0....1..0..1..2....0..1..2..2....1..2..1..0....1..2..1..0
..2..1..2..0....2..0..1..0....0..2..1..0....0..0..2..0....1..0..2..2
		

Crossrefs

Column 1 is A028859

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) +2*a(n-2)
k=2: a(n) = 4*a(n-1) +a(n-2) -2*a(n-3)
k=3: [order 12]
k=4: [order 24] for n>25
k=5: [order 64] for n>65

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

A274803 T(n,k)=Number of nXk 0..2 arrays with no element equal to any value at offset (-1,-2) (-2,-1) (0,-1) or (-1,0) and new values introduced in order 0..2.

Original entry on oeis.org

1, 1, 1, 2, 3, 2, 4, 8, 8, 4, 8, 22, 30, 22, 8, 16, 60, 112, 112, 60, 16, 32, 164, 420, 596, 420, 164, 32, 64, 448, 1572, 3104, 3104, 1572, 448, 64, 128, 1224, 5888, 16328, 22988, 16328, 5888, 1224, 128, 256, 3344, 22048, 85504, 169328, 169328, 85504, 22048, 3344
Offset: 1

Views

Author

R. H. Hardin, Jul 07 2016

Keywords

Comments

Table starts
...1....1......2........4.........8..........16...........32.............64
...1....3......8.......22........60.........164..........448...........1224
...2....8.....30......112.......420........1572.........5888..........22048
...4...22....112......596......3104.......16328........85504.........448656
...8...60....420.....3104.....22988......169328......1252608........9243332
..16..164...1572....16328....169328.....1774372.....18476064......193292660
..32..448...5888....85504...1252608....18476064....273764292.....4044928780
..64.1224..22048...448656...9243332...193292660...4044928780....85071335388
.128.3344..82568..2352080..68301192..2016460140..59936952948..1784175028356
.256.9136.309200.12335680.504334580.21072173792.886462457880.37524080122192

Examples

			Some solutions for n=4 k=4
..0..1..0..2. .0..1..2..0. .0..1..2..1. .0..1..2..1. .0..1..0..1
..1..2..1..0. .1..0..1..2. .1..2..1..2. .1..0..1..0. .1..0..1..2
..0..1..0..1. .0..1..2..1. .2..1..0..1. .2..1..2..1. .0..1..2..1
..2..0..1..2. .1..0..1..0. .1..2..1..0. .0..2..1..0. .1..2..1..2
		

Crossrefs

Column 1 is A000079(n-2).
Column 2 is A028859(n-1).

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) for n>2
k=2: a(n) = 2*a(n-1) +2*a(n-2)
k=3: a(n) = 2*a(n-1) +6*a(n-2) +2*a(n-3)
k=4: a(n) = 2*a(n-1) +15*a(n-2) +11*a(n-3) -2*a(n-4) -2*a(n-5)
k=5: a(n) = 2*a(n-1) +35*a(n-2) +42*a(n-3) -41*a(n-4) -60*a(n-5) -23*a(n-6) -2*a(n-7)
k=6: [order 14] for n>15
k=7: [order 25] for n>26

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

Original entry on oeis.org

1, 3, 9, 25, 69, 189, 517, 1413, 3861, 10549, 28821, 78741, 215125, 587733, 1605717, 4386901, 11985237, 32744277, 89459029, 244406613, 667731285, 1824275797, 4984014165, 13616579925, 37201188181, 101635536213, 277673448789, 758617970005, 2072582837589, 5662401615189
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Number of (s(0), s(1), ..., s(n+2)) such that 0 < s(i) < 6 and |s(i) - s(i-1)| <= 1 for i = 1..n+2, s(0) = 1, s(n+2) = 3. - Herbert Kociemba, Jun 17 2004
A Whitney transform of 2^n (see Benoit Cloitre formula and A004070). The Whitney transform maps the sequence with g.f. g(x) to that with g.f. (1/(1-x))g(x(1+x)). - Paul Barry, Feb 16 2005

Crossrefs

First differences are in A002605.

Programs

  • Mathematica
    CoefficientList[Series[1 / (1 - 3 x + 2 x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 19 2013 *)
    LinearRecurrence[{3,0,-2},{1,3,9},40] (* Harvey P. Dale, Apr 27 2014 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,n,2^j*binomial(j,i-j)))
    
  • PARI
    Vec(1/(1-3*x+2*x^3) + O(x^100)) \\ Altug Alkan, Mar 24 2016

Formula

a(n) = 3*a(n-1) - 2*a(n-3) = 2*A057960(n) - 1 = round(2*A028859(n)/sqrt(3) - 1/3) = Sum_{i} b(n, i), where b(n, 0) = b(n, 6) = 0, b(0, 3) = 1, b(0, i) = 0 if i <> 3 and b(n+1, i) = b(n, i-1) + b(n, i) + b(n, i+1) if 0 < i < 6 (i.e., the number of three-choice paths along a corridor width 5, starting from the middle). - Henry Bottomley, Mar 06 2003
Binomial transform of A068911. a(n) = (1+sqrt(3))^n*(2+sqrt(3))/3 + (1-sqrt(3))^n*(2-sqrt(3))/3 - 1/3. - Paul Barry, Feb 17 2004
a(0)=1; for n >= 1, a(n) = ceiling((1+sqrt(3))*a(n-1)). - Benoit Cloitre, Jun 19 2004
a(n) = Sum_{i=0..n} Sum_{j=0..n} 2^j*binomial(j, i-j). - Benoit Cloitre, Oct 23 2004
a(n) = 2*(a(n-1) + a(n-2)) + 1, n > 1. - Gary Detlefs, Jun 20 2010
a(n) = (2*A052945(n+1) - 1)/3. - R. J. Mathar, Mar 31 2011
a(n) = floor((1+sqrt(3))^(n+2)/6). - Bruno Berselli, Feb 05 2013
a(n) = (-2 + (1-sqrt(3))^(n+2) + (1+sqrt(3))^(n+2))/6. - Alexander R. Povolotsky, Feb 13 2016
E.g.f.: exp(x)*(4*cosh(sqrt(3)*x) + 2*sqrt(3)*sinh(sqrt(3)*x) - 1)/3. - Stefano Spezia, Mar 02 2024

Extensions

Name changed by Arkadiusz Wesolowski, Dec 06 2011

A216314 G.f. satisfies A(x) = (1 + x*A(x)) * (1 + 2*x*A(x)^2).

Original entry on oeis.org

1, 3, 17, 121, 965, 8247, 73841, 683713, 6493145, 62898859, 619079889, 6173490857, 62239144525, 633323532783, 6496052173665, 67093423506049, 697181754821297, 7283521984427283, 76455801614169809, 806004056649062937, 8529783421905380629, 90584730265930813607
Offset: 0

Views

Author

Paul D. Hanna, Sep 03 2012

Keywords

Comments

The radius of convergence of g.f. A(x) is r = 0.08774268876242660659654020... with A(r) = 2.04748732367111203761312028274219344812311691... where y=A(r) satisfies 6*y^3 - 14*y^2 + 4*y - 1 = 0.
r = 1/(((40465 + 387*sqrt(129))^(2/3) + 1174 + 34*(40465 + 387*sqrt(129))^(1/3)) / (40465+387*sqrt(129))^(1/3)/9). - Vaclav Kotesovec, Sep 17 2013

Examples

			G.f.: A(x) = 1 + 3*x + 17*x^2 + 121*x^3 + 965*x^4 + 8247*x^5 + 73841*x^6 +...
Related expansions.
A(x)^2 = 1 + 6*x + 43*x^2 + 344*x^3 + 2945*x^4 + 26398*x^5 + 244615*x^6 +...
A(x)^3 = 1 + 9*x + 78*x^2 + 696*x^3 + 6399*x^4 + 60321*x^5 + 580316*x^6 +...
where A(x) = 1 + A(x)*(1+2*A(x))*x + 2*A(x)^3*x^2.
The g.f. also satisfies the series:
A(x) = 1 + 3*x*A(x) + 8*x^2*A(x)^2 + 22*x^3*A(x)^3 + 60*x^4*A(x)^4 + 164*x^5*A(x)^5 + 448*x^6*A(x)^6 +...+ A028859(n)*x^n*A(x)^n +...
The logarithm of the g.f. equals the series:
log(A(x)) = (1*2 + 1/A(x))*x*A(x) + (1*2^2 + 2^2*2/A(x) + 1/A(x)^2)*x^2*A(x)^2/2 +
(1*2^3 + 3^2*2^2/A(x) + 3^2*2/A(x)^2 + 1/A(x)^3)*x^3*A(x)^3/3 +
(1*2^4 + 4^2*2^3/A(x) + 6^2*2^2/A(x)^2 + 4^2*2/A(x)^3 + 1/A(x)^4)*x^4*A(x)^4/4 +
(1*2^5 + 5^2*2^4/A(x) + 10^2*2^3/A(x)^2 + 10^2*2^2/A(x)^3 + 5^2*2/A(x)^4 + 1/A(x)^5)*x^5*A(x)^5/5 +...
Explicitly,
log(A(x)) = 3*x + 25*x^2/2 + 237*x^3/3 + 2361*x^4/4 + 24203*x^5/5 + 252757*x^6/6 + 2674185*x^7/7 + 28567105*x^8/8 +...+ L(n)*x^n/n +...
where L(n) = [x^n] (1+x)^n/(1-2*x-2*x^2)^n.
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[1/x * InverseSeries[Series[x*(1 - 2*x - 2*x^2)/(1+x),{x,0,20}],x],x] (* Vaclav Kotesovec, Sep 17 2013 *)
  • PARI
    {a(n)=local(A=1+x); for(i=1, n, A=(1 + x*A)*(1 + 2*x*(A+x*O(x^n))^2)); polcoeff(A, n)}
    
  • PARI
    {a(n)=polcoeff( (1/x)*serreverse( x*(1-2*x-2*x^2)/(1+x +x*O(x^n))), n)}
    
  • PARI
    {a(n)=local(A=1+x+x*O(x^n)); for(i=1, n, A=exp(sum(m=1, n, sum(j=0, m, binomial(m, j)^2*2^(m-j)/A^j)*x^m*A^m/m))); polcoeff(A, n)}
    for(n=0, 31, print1(a(n), ", "))

Formula

G.f. A(x) satisfies:
(1) A(x) = exp( Sum_{n>=1} x^n*A(x)^n/n * Sum_{k=0..n} C(n,k)^2 * 2^(n-k)/A(x)^k ).
(2) A(x) = (1/x) * Series_Reversion( x*(1 - 2*x - 2*x^2)/(1+x) ).
(3) A(x) = Sum_{n>=0} A028859(n) * x^n * A(x)^n, where g.f. of A028859 = (1+x)/(1-2*x-2*x^2).
The formal inverse of the g.f. A(x) is (sqrt(1-4*x+12*x^2) - (1+2*x))/(4*x^2).
a(n) = [x^n] ( (1+x)/(1-2*x-2*x^2) )^(n+1) / (n+1).
Recurrence: 3*n*(n+1)*(43*n-76)*a(n) = n*(1462*n^2 - 3315*n + 1274)*a(n-1) + (86*n^3 - 324*n^2 + 523*n - 330)*a(n-2) + (n-2)*(2*n-5)*(43*n-33)*a(n-3)
a(n) ~ 1/516*sqrt(86)*sqrt((1448486261 + 1803807*sqrt(129))^(1/3)*((1448486261 + 1803807*sqrt(129))^(2/3) + 1280110 + 1118*(1448486261 + 1803807*sqrt(129))^(1/3)))/(1448486261 + 1803807*sqrt(129))^(1/3) * (((40465 + 387*sqrt(129))^(2/3) + 1174 + 34*(40465 + 387*sqrt(129) )^(1/3)) / (40465+387*sqrt(129))^(1/3)/9)^n / (n^(3/2)*sqrt(Pi)). - Vaclav Kotesovec, Sep 17 2013
a(n) = Sum_{k=0..n} 2^k * binomial(n+k+1,k) * binomial(n+k+1,n-k) / (n+k+1). - Seiichi Manyama, Sep 08 2024

A180165 Triangle read by rows, derived from an array of sequences generated from (1 + x)/ (1 - r*x - r*x^2).

Original entry on oeis.org

1, 1, 2, 1, 3, 3, 1, 4, 8, 5, 1, 5, 15, 22, 8, 1, 6, 24, 57, 60, 13, 1, 7, 35, 116, 216, 164, 21, 1, 8, 48, 205, 560, 819, 448, 34, 1, 9, 63, 330, 1200, 2704, 3105, 1224, 55, 1, 10, 80, 497, 2268, 7025, 13056, 11772, 3344, 89, 1, 11, 99, 712, 3920, 15588, 41125, 63040, 44631, 9136, 144
Offset: 1

Views

Author

Gary W. Adamson, Aug 14 2010

Keywords

Comments

Row sums = A180166: (1, 3, 7, 18, 51, 161, 560, 2163, ...).
Rows of the array, with other offsets: (row 1 = A000045 starting with offset 2: (1, 2, 3, 5, 8, 13, ...); and for rows > 1, the entries: A028859, A125145, A086347, and A180033 start with offset 0; with the offset in the present array = 1.

Examples

			First few rows of the triangle:
  1;
  1, 2;
  1, 3, 3;
  1, 4, 8, 5;
  1, 5, 15, 22, 8;
  1, 6, 24, 57, 60, 13;
  1, 7, 35, 116, 216, 164, 21;
  1, 8, 48, 205, 560, 819, 448, 34;
  1, 9, 63, 330, 1200, 2704, 3105, 1224, 55;
  1, 10, 80, 497, 2268, 7025, 13056, 11772, 3344, 89;
  1, 11, 99, 712, 3920, 15588, 41125, 63040, 44631, 9136, 144;
  1, 12, 120, 981, 6336, 30919, 107136, 240750, 304384, 169209, 24960, 233;
  ...
As an array A(r,k) by upwards antidiagonals:
        k=1  k=2  k=3   k=4    k=5
  r=1:   1,   2,    3,    5,     8, ...
  r=2:   1,   3,    8,   22,    60, ...
  r=3:   1,   4,   15,   57,   216, ...
  r=4:   1,   5,   24,  116,   560, ...
  r=5:   1,   6,   35,  205,  1200, ...
Row r=5 = A180033 = (1, 6, 35, 205,...) and is generated from (1+x)/(1-5*x-5*x^2); is the INVERT transform of row r=4; and the array term A(5,4) = 205 = 5*35 + 5*6.
Terms A(2,4) and A(2,5) = [22,60] = [0,1; 2,2]^3 * [1,3].
		

Crossrefs

Programs

  • Mathematica
    A180165[a_] := Reverse[Table[Table[CoefficientList[Series[(1 + x)/(1 - r*x - r*x^2), {x, 0, a - 2}], x], {r, 1, a + 1}][[k, n - k]], {n, 1, a}, {k, 1, n - 1}], 2] // Flatten;
    A180165[12] (* Robert P. P. McKone, Jan 19 2021 *)

Formula

Triangle read by rows, generated from an array of sequences generated from (1 + x)/(1 - r*x - r*x^2); r > 0.
Alternatively, given the array with offset 1, the sequence r-th sequence is generated from a(k) = r*a(k-1) + r*(k-2); a(1) = 1, a(2) = r+1.
With a matrix method, the array can be generated from a 2 X 2 matrix of the form [0,1; r,r] = M, such that M^n * [1,r+1] = [r,n+1; r,n+2].
Also, for r > 1, the (r+1)-th row of the array is the INVERT transform of the r-th row.

Extensions

a(35) corrected by Robert P. P. McKone, Dec 31 2020

A209144 Triangle of coefficients of polynomials v(n,x) jointly generated with A209143; see the Formula section.

Original entry on oeis.org

1, 3, 6, 1, 12, 5, 24, 16, 1, 48, 44, 7, 96, 112, 30, 1, 192, 272, 104, 9, 384, 640, 320, 48, 1, 768, 1472, 912, 200, 11, 1536, 3328, 2464, 720, 70, 1, 3072, 7424, 6400, 2352, 340, 13, 6144, 16384, 16128, 7168, 1400, 96, 1, 12288, 35840, 39680, 20736
Offset: 1

Views

Author

Clark Kimberling, Mar 06 2012

Keywords

Comments

Alternating row sums: 1,3,5,7,9,11,13,15,17,...
For a discussion and guide to related arrays, see A208510.
Subtriangle of the triangle given by (3,-1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 1/3, -1/3, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938. - Philippe Deléham, Mar 07 2012

Examples

			First five rows:
   1;
   3;
   6,  1;
  12,  5;
  24, 16, 1;
First three polynomials v(n,x): 1, 3, 6 + x.
(3,-1, 0, 0, 0, ...) DELTA (0, 1/3, -1/3, 0, 0, ...) begins:
    1;
    3,   0;
    6,   1,   0;
   12,   5,   0, 0;
   24,  16,   1, 0, 0;
   48,  44,   7, 0, 0, 0;
   96, 112,  30, 1, 0, 0, 0;
  192, 272, 104, 9, 0, 0, 0, 0;
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := u[n - 1, x] + (x + 1)*v[n - 1, x];
    v[n_, x_] := u[n - 1, x] + v[n - 1, x] + 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A209143 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A209144 *)

Formula

u(n,x) = u(n-1,x) + (x+1)*v(n-1,x),
v(n,x) = u(n-1,x) + v(n-1,x) + 1,
where u(1,x)=1, v(1,x)=1.
From Philippe Deléham, Mar 07 2012: (Start)
As triangle T(n,k) with 0 <= k <= n:
T(n,k) = 2*T(n-1,k) + T(n-2,k-1), T(0,0) = 1, T(1,0) = 3, T(1,1) = 0 and T(n,k) = 0 if k < 0 or if k > n.
G.f.: (1+x)/(1-2*x-y*x^2).
Sum_{k=0..n} T(n,k)*x^k = A005408(n), A003945(n), A078057(n), A028859(n), A000244(n), A063782(n), A180168(n) for x = -1, 0, 1, 2, 3, 4, 5 respectively. (End)

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

A340156 Square array read by upward antidiagonals: T(n, k) is the number of n-ary strings of length k containing 00.

Original entry on oeis.org

1, 1, 3, 1, 5, 8, 1, 7, 21, 19, 1, 9, 40, 79, 43, 1, 11, 65, 205, 281, 94, 1, 13, 96, 421, 991, 963, 201, 1, 15, 133, 751, 2569, 4612, 3217, 423, 1, 17, 176, 1219, 5531, 15085, 20905, 10547, 880, 1, 19, 225, 1849, 10513, 39186, 86241, 92935, 34089, 1815
Offset: 2

Views

Author

Robert P. P. McKone, Dec 29 2020

Keywords

Examples

			For n = 3 and k = 4, there are 21 strings: {0000, 0001, 0002, 0010, 0011, 0012, 0020, 0021, 0022, 0100, 0200, 1000, 1001, 1002, 1100, 1200, 2000, 2001, 2002, 2100, 2200}.
Square table T(n,k):
     k=2:  k=3:  k=4:   k=5:    k=6:     k=7:
n=2:   1     3     8     19      43       94
n=3:   1     5    21     79     281      963
n=4:   1     7    40    205     991     4612
n=5:   1     9    65    421    2569    15085
n=6:   1    11    96    751    5531    39186
n=7:   1    13   133   1219   10513    87199
n=8:   1    15   176   1849   18271   173608
n=9:   1    17   225   2665   29681   317817
		

Crossrefs

Cf. A008466 (row 2), A186244 (row 3), A000567 (column 4).
Cf. A180165 (not containing 00), A340242 (containing 000).

Programs

  • Mathematica
    m[r_] := Normal[With[{p = 1/n}, SparseArray[{Band[{1, 2}] -> p, {i_, 1} /; i <= r -> 1 - p, {r + 1, r + 1} -> 1}]]];
    T[n_, k_, r_] := MatrixPower[m[r], k][[1, r + 1]]*n^k;
    Reverse[Table[T[n, k - n + 2, 2], {k, 2, 11}, {n, 2, k}], 2] // Flatten (* Robert P. P. McKone, Jan 26 2021 *)

Formula

T(n, k) = n^k - A180165(n+1,k-1), where A180165 in the number of strings not containing 00.
m(2) = [1 - 1/n, 1/n, 0; 1 - 1/n, 0, 1/n; 0, 0, 1], is the probability/transition matrix for two consecutive "0" -> "containing 00".
Previous Showing 21-30 of 38 results. Next