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

A173258 Number of compositions of n where differences between neighboring parts are in {-1,1}.

Original entry on oeis.org

1, 1, 1, 3, 2, 4, 5, 5, 7, 10, 9, 14, 16, 19, 24, 31, 35, 45, 55, 66, 84, 104, 124, 156, 192, 236, 292, 363, 444, 551, 681, 839, 1040, 1287, 1586, 1967, 2430, 3001, 3717, 4597, 5683, 7034, 8697, 10758, 13312, 16469, 20369, 25204, 31180, 38574, 47726, 59047
Offset: 0

Views

Author

Alois P. Heinz, Jul 08 2012

Keywords

Examples

			a(3) = 3: [3], [2,1], [1,2].
a(4) = 2: [4], [1,2,1].
a(5) = 4: [5], [3,2], [2,3], [2,1,2].
a(6) = 5: [6], [3,2,1], [2,1,2,1], [1,2,3], [1,2,1,2].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember;
          `if`(n<1 or i<1, 0, `if`(n=i, 1, add(b(n-i, i+j), j=[-1, 1])))
        end:
    a:= n-> `if`(n=0, 1, add(b(n, j), j=1..n)):
    seq(a(n), n=0..70);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n < 1 || i < 1, 0, If[n == i, 1, Sum[b[n - i, i + j], {j, {-1, 1}}]]]; a[n_] := If[n == 0, 1, Sum[b[n, j], {j, 1, n}]]; Table[a[n], {n, 0, 70}] // Flatten (* Jean-François Alcover, Dec 13 2013, translated from Maple *)
  • PARI
    step(R,n)={matrix(n, n, i, j, if(i>j, if(j>1, R[i-j, j-1]) + if(j+1<=n, R[i-j, j+1])) )}
    a(n)={my(R=matid(n), t=(n==0), m=0); while(R, m++; t+=vecsum(R[n,]); R=step(R,n)); t} \\ Andrew Howroyd, Aug 23 2019

Formula

a(n) ~ c * d^n, where d=1.23729141259673487395949649334678514763130846902468..., c=1.134796087242490181499736234755111281606636700030106.... - Vaclav Kotesovec, May 01 2014
G.f.: 1 + Sum_{k>0} G(x,k) where G(x,k) = x^k*(1 + G(x,k+1) + G(x,k-1)) for k > 0 and G(x,0) = 0. - John Tyler Rascoe, Sep 16 2023

A227309 G.f.: 1/G(0) where G(k) = 1 - q^(k+1) / (1 - q^(k+2)/G(k+1) ).

Original entry on oeis.org

1, 1, 1, 2, 3, 6, 10, 19, 34, 63, 115, 213, 391, 723, 1333, 2463, 4547, 8403, 15522, 28686, 53006, 97963, 181042, 334606, 618415, 1142994, 2112545, 3904592, 7216810, 13338856, 24654268, 45568784, 84225393, 155675230, 287737327, 531830605, 982993368, 1816887637, 3358192905
Offset: 0

Views

Author

Joerg Arndt, Jul 06 2013

Keywords

Comments

Sums along falling diagonals of A161492 (skew Ferrers diagrams by area and number of columns). [Joerg Arndt, Mar 23 2014]

Crossrefs

Cf. A049346 (g.f.: 1-1/G(0), G(k)= 1 + q^(k+1) / (1 - q^(k+1)/G(k+1) ) ).
Cf. A227310 (g.f.: 1/G(0), G(k) = 1 + (-q)^(k+1) / (1 - (-q)^(k+1)/G(k+1) ) ).
Cf. A226728 (g.f.: 1/G(0), G(k) = 1 + q^(k+1) / (1 - q^(k+1)/G(k+2) ) ).
Cf. A226729 (g.f.: 1/G(0), G(k) = 1 - q^(k+1) / (1 - q^(k+1)/G(k+2) ) ).
Cf. A006958 (g.f.: 1/G(0), G(k) = 1 - q^(k+1) / (1 - q^(k+1)/G(k+1) ) ).

Programs

  • Mathematica
    nmax = 40; CoefficientList[Series[1/Fold[(1 - #2/#1) &, 1, Reverse[x^(Range[2, nmax] - Floor[Range[2, nmax]/2])]], {x, 0, nmax}], x] (* Vaclav Kotesovec, Sep 05 2017 *)
  • PARI
    N = 66;  q = 'q + O('q^N);
    G(k) = if(k>N, 1, 1 - q^(k+1) / (1 - q^(k+2) / G(k+1) ) );
    Vec( 1 / G(0) )
    
  • PARI
    /* formula from the Delest/Fedou reference with t=q: */
    N=66;  q='q+O('q^N);  t=q;
    qn(n) = prod(k=1, n, 1-q^k );
    nm = sum(n=0, N, (-1)^n* q^(n*(n+1)/2) / ( qn(n) * qn(n+1) ) * (t*q)^(n+1) );
    dn = sum(n=0, N, (-1)^n* q^(n*(n-1)/2) / ( qn(n)^2 ) * (t*q)^n );
    v=Vec(nm/dn)

Formula

G.f.: 1/(1-q /(1-q^2/(1-q^2/(1-q^3/(1-q^3/(1-q^4/(1-q^4/(1-q^5/(1-q^5/(1-...) )) )) )) )) ).
G.f.: 1/x - Q(0)/(2*x), where Q(k)= 1 + 1/(1 - 1/(1 - 1/(2*x^(k+1)) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 09 2013
G.f.: 1/x - U(0)/x, where U(k)= 1 - x^(k+1)/(1 - x^(k+1)/U(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Aug 15 2013
G.f.: -W(0)/x, where W(k)= 1 - x^(k+1) - x^k - x^(2*k+2)/W(k+1); (continued fraction). - Sergei N. Gladkovskii, Aug 15 2013
G.f.: G(0) where G(k) = 1 - q/(q^(k+2) - 1 / G(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jan 18 2016
a(n) ~ c * d^n, where d = 1.84832326133106924642685135202616091890310896530577301386219207630312784... and c = 0.244648950328338656997216931963422920467577616734159139510762093105072... - Vaclav Kotesovec, Sep 05 2017

A239927 Triangle read by rows: T(n,k) is the number of Dyck paths of semilength k such that the area between the x-axis and the path is n (n>=0; 0<=k<=n).

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 4, 0, 1, 0, 0, 0, 0, 3, 0, 5, 0, 1, 0, 0, 0, 1, 0, 6, 0, 6, 0, 1, 0, 0, 0, 0, 3, 0, 10, 0, 7, 0, 1, 0, 0, 0, 0, 0, 7, 0, 15, 0, 8, 0, 1, 0, 0, 0, 0, 2, 0, 14, 0, 21, 0, 9, 0, 1, 0, 0, 0, 0, 0, 7, 0, 25, 0, 28, 0, 10, 0, 1, 0, 0, 0, 0, 1, 0, 17, 0, 41, 0, 36, 0, 11, 0, 1
Offset: 0

Views

Author

Joerg Arndt, Mar 29 2014

Keywords

Comments

Triangle A129182 transposed.
Column sums give the Catalan numbers (A000108).
Row sums give A143951.
Sums along falling diagonals give A005169.
T(4n,2n) = A240008(n). - Alois P. Heinz, Mar 30 2014

Examples

			Triangle begins:
00:  1;
01:  0, 1;
02:  0, 0, 1;
03:  0, 0, 0, 1;
04:  0, 0, 1, 0, 1;
05:  0, 0, 0, 2, 0, 1;
06:  0, 0, 0, 0, 3, 0, 1;
07:  0, 0, 0, 1, 0, 4, 0, 1;
08:  0, 0, 0, 0, 3, 0, 5, 0, 1;
09:  0, 0, 0, 1, 0, 6, 0, 6, 0, 1;
10:  0, 0, 0, 0, 3, 0, 10, 0, 7, 0, 1;
11:  0, 0, 0, 0, 0, 7, 0, 15, 0, 8, 0, 1;
12:  0, 0, 0, 0, 2, 0, 14, 0, 21, 0, 9, 0, 1;
13:  0, 0, 0, 0, 0, 7, 0, 25, 0, 28, 0, 10, 0, 1;
14:  0, 0, 0, 0, 1, 0, 17, 0, 41, 0, 36, 0, 11, 0, 1;
15:  0, 0, 0, 0, 0, 5, 0, 35, 0, 63, 0, 45, 0, 12, 0, 1;
16:  0, 0, 0, 0, 1, 0, 16, 0, 65, 0, 92, 0, 55, 0, 13, 0, 1;
17:  0, 0, 0, 0, 0, 5, 0, 40, 0, 112, 0, 129, 0, 66, 0, 14, 0, 1;
18:  0, 0, 0, 0, 0, 0, 16, 0, 86, 0, 182, 0, 175, 0, 78, 0, 15, 0, 1;
19:  0, 0, 0, 0, 0, 3, 0, 43, 0, 167, 0, 282, 0, 231, 0, 91, 0, 16, 0, 1;
20:  0, 0, 0, 0, 0, 0, 14, 0, 102, 0, 301, 0, 420, 0, 298, 0, 105, 0, 17, 0, 1;
...
Column k=4 corresponds to the following 14 paths (dots denote zeros):
#:         path              area   steps (Dyck word)
01:  [ . 1 . 1 . 1 . 1 . ]     4     + - + - + - + -
02:  [ . 1 . 1 . 1 2 1 . ]     6     + - + - + + - -
03:  [ . 1 . 1 2 1 . 1 . ]     6     + - + + - - + -
04:  [ . 1 . 1 2 1 2 1 . ]     8     + - + + - + - -
05:  [ . 1 . 1 2 3 2 1 . ]    10     + - + + + - - -
06:  [ . 1 2 1 . 1 . 1 . ]     6     + + - - + - + -
07:  [ . 1 2 1 . 1 2 1 . ]     8     + + - - + + - -
08:  [ . 1 2 1 2 1 . 1 . ]     8     + + - + - - + -
09:  [ . 1 2 1 2 1 2 1 . ]    10     + + - + - + - -
10:  [ . 1 2 1 2 3 2 1 . ]    12     + + - + + - - -
11:  [ . 1 2 3 2 1 . 1 . ]    10     + + + - - - + -
12:  [ . 1 2 3 2 1 2 1 . ]    12     + + + - - + - -
13:  [ . 1 2 3 2 3 2 1 . ]    14     + + + - + - - -
14:  [ . 1 2 3 4 3 2 1 . ]    16     + + + + - - - -
There are no paths with weight < 4, one with weight 4, none with weight 5, 3 with weight 6, etc., therefore column k=4 is
[0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 3, 0, 2, 0, 1, 0, 1, 0, 0, 0, ...].
Row n=8 is [0, 0, 0, 0, 3, 0, 5, 0, 1], the corresponding paths of weight=8 are:
Semilength 4:
  [ . 1 . 1 2 1 2 1 . ]
  [ . 1 2 1 . 1 2 1 . ]
  [ . 1 2 1 2 1 . 1 . ]
Semilength 6:
  [ . 1 . 1 . 1 . 1 . 1 2 1 . ]
  [ . 1 . 1 . 1 . 1 2 1 . 1 . ]
  [ . 1 . 1 . 1 2 1 . 1 . 1 . ]
  [ . 1 . 1 2 1 . 1 . 1 . 1 . ]
  [ . 1 2 1 . 1 . 1 . 1 . 1 . ]
Semilength 8:
  [ . 1 . 1 . 1 . 1 . 1 . 1 . 1 . 1 . ]
		

Crossrefs

Sequences obtained by particular choices for x and y in the g.f. F(x,y) are: A000108 (F(1, x)), A143951 (F(x, 1)), A005169 (F(sqrt(x), sqrt(x))), A227310 (1+x*F(x, x^2), also 2-1/F(x, 1)), A239928 (F(x^2, x)), A052709 (x*F(1,x+x^2)), A125305 (F(1, x+x^3)), A002212 (F(1, x/(1-x))).
Cf. A129181.

Programs

  • Maple
    b:= proc(x, y, k) option remember;
          `if`(y<0 or y>x or k<0, 0, `if`(x=0, `if`(k=0, 1, 0),
           b(x-1, y-1, k-y+1/2)+ b(x-1, y+1, k-y-1/2)))
        end:
    T:= (n, k)-> b(2*k, 0, n):
    seq(seq(T(n, k), k=0..n), n=0..20);  # Alois P. Heinz, Mar 29 2014
  • Mathematica
    b[x_, y_, k_] := b[x, y, k] = If[y<0 || y>x || k<0, 0, If[x == 0, If[k == 0, 1, 0], b[x-1, y-1, k-y+1/2] + b[x-1, y+1, k-y-1/2]]]; T[n_, k_] := b[2*k, 0, n]; Table[ Table[T[n, k], {k, 0, n}], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 18 2015, after Alois P. Heinz *)
  • PARI
    rvec(V) = { V=Vec(V); my(n=#V); vector(n, j, V[n+1-j] ); }
    print_triangle(V)= { my( N=#V ); for(n=1, N, print( rvec( V[n]) ) ); }
    N=20; x='x+O('x^N);
    F(x,y, d=0)=if (d>N, 1, 1 / (1-x*y * F(x, x^2*y, d+1) ) );
    v= Vec( F(x,y) );
    print_triangle(v)

Formula

G.f.: F(x,y) satisfies F(x,y) = 1 / (1 - x*y * F(x, x^2*y) ).
G.f.: 1/(1 - y*x/(1 - y*x^3/(1 - y*x^5/(1 - y*x^7/(1 - y*x^9/( ... )))))).

A049346 Coefficient of x^(-n) in expansion of continued fraction 0, x, x^2, x^3, x^4, ... .

Original entry on oeis.org

0, 1, 0, 0, -1, 0, 0, 1, 0, 1, -1, 0, -2, 1, -1, 3, -2, 3, -4, 4, -6, 7, -8, 11, -13, 16, -20, 24, -31, 37, -46, 58, -70, 88, -108, 133, -167, 204, -252, 315, -386, 479, -594, 731, -909, 1122, -1386, 1720, -2124, 2628, -3254, 4022, -4980, 6160, -7618, 9432, -11665, 14433, -17860, 22093, -27341, 33824, -41847
Offset: 0

Views

Author

Alain Lasjauniasith (lasjauni(AT)math.u-bordeaux.fr.yyy.com)

Keywords

Comments

Absolute values are essentially A227310. - Franklin T. Adams-Watters, Oct 31 2014

Formula

G.f.: 1 - 1/G(0), where G(k)= 1 + x^(k+1)/(1 - x^(k+1)/G(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jun 29 2013
G.f.: W(0) - 1, where W(k) = 1 - x^(k+1)/( x^(k+1) - 1/(1 - x^(k+1)/( x^(k+1) + 1/W(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Aug 27 2013

Extensions

Added more terms, Joerg Arndt, Jun 29 2013

A285407 G.f.: 1/(1 - x^2/(1 - x^3/(1 - x^5/(1 - x^7/(1 - x^11/(1 - ... - x^prime(k)/(1 - ... ))))))), a continued fraction.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 1, 2, 2, 3, 5, 5, 9, 11, 15, 23, 28, 43, 57, 78, 113, 149, 214, 293, 403, 569, 774, 1086, 1502, 2072, 2896, 3986, 5548, 7691, 10636, 14797, 20459, 28400, 39386, 54542, 75724, 104886, 145468, 201733, 279545, 387786, 537472, 745233, 1033383, 1432415, 1986394
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 18 2017

Keywords

Examples

			G.f.: A(x) = 1 + x^2 + x^4 + x^5 + x^6 + 2*x^7 + 2*x^8 + 3*x^9 + 5*x^10 + ...
		

Crossrefs

Programs

  • Maple
    R:= 1:
    for i from numtheory:-pi(50) to 1 by -1 do
      R:= series(1-x^ithprime(i)/R, x, 51);
    od:
    R:= series(1/R, x, 51):
    seq(coeff(R,x,j),j=0..50); # Robert Israel, Apr 20 2017
  • Mathematica
    nmax = 50; CoefficientList[Series[1/(1 + ContinuedFractionK[-x^Prime[k], 1, {k, 1, nmax}]), {x, 0, nmax}], x]

Formula

a(n) ~ c * d^n, where d = 1.3864622092472465020397266918102624708859968795203700659786636158522760956... and c = 0.15945087310540003725148530084775272562567007586487061850065597143186... - Vaclav Kotesovec, Aug 25 2017

A291904 Triangle read by rows: T(n,k) = T(n-k,k-1) + T(n-k,k+1) with T(0,0) = 1 for 0 <= k <= A003056(n).

Original entry on oeis.org

1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 2, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 3, 2, 0, 0, 3, 2, 1, 1, 1, 0, 2, 3, 2, 1, 0, 0, 3, 4, 3, 1, 0, 0, 4, 4, 3, 2, 1, 0, 4, 6, 4, 2, 0, 0, 6, 7
Offset: 0

Views

Author

Seiichi Manyama, Sep 05 2017

Keywords

Comments

T(n,k) is the number of integer compositions of n with first part 1, last part k, and all adjacent differences in {-1,1}. - John Tyler Rascoe, Aug 14 2023

Examples

			First few rows are:
  1;
  0, 1;
  0, 0;
  0, 0, 1;
  0, 1, 0;
  0, 0, 0;
  0, 0, 1, 1;
  0, 1, 0, 0;
  0, 0, 1, 0;
  0, 1, 1, 1;
  0, 1, 0, 0, 1;
  0, 0, 2, 1, 0;
  0, 2, 1, 1, 0.
		

Crossrefs

Row sums give A291905.
Columns 0-1 give A000007, A227310 (for n>0).

Programs

  • Mathematica
    T[0, 0] = 1; T[, 0] = 0; T[n?Positive, k_] /; 0 < k <= Floor[(Sqrt[8n+1] - 1)/2] := T[n, k] = T[n-k, k-1] + T[n-k, k+1]; T[, ] = 0;
    Table[T[n, k], {n, 0, 20}, {k, 0, Floor[(Sqrt[8n+1] - 1)/2]}] // Flatten (* Jean-François Alcover, May 29 2019 *)

Formula

From John Tyler Rascoe, Aug 14 2023: (Start)
This triangle is T_1(n,k) of the general triangle T_m(n,k) for compositions of this kind with first part m.
T_m(n,k) for 0 < m, 0 <= n, and 0 <= k <= A003056(n+A000217(m-1)).
T_m(0,0) = T_m(m,m) = 1.
T_m(n,k) = T_m(n-k,k-1) + T_m(n-k,k+1) for m < n and 0 < k <= A003056(n+A000217(m-1)).
T_m(n,k) = 0 for 0 < n < m or n < k.
T_m(n,0) = 0 for 0 < n. (End)

A238870 Number of compositions of n with c(1) = 1, c(i+1) - c(i) <= 1, and c(i+1) - c(i) != 0.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 2, 2, 1, 4, 4, 4, 9, 10, 11, 21, 25, 30, 51, 62, 80, 125, 157, 208, 309, 399, 536, 772, 1013, 1373, 1938, 2574, 3503, 4882, 6540, 8918, 12329, 16611, 22672, 31183, 42182, 57588, 78952, 107092, 146202, 200037, 271831, 371057, 507053, 689885, 941558, 1285655, 1750672, 2388951, 3260459, 4442179, 6060948
Offset: 0

Views

Author

Joerg Arndt, Mar 09 2014

Keywords

Comments

Number of fountains of n coins with at most two successive coins on the same level.

Examples

			The a(10) = 4 such compositions are:
:
:   1:  [ 1 2 1 2 1 2 1 ]  (composition)
:
:  o o o
: ooooooo   (rendering as composition)
:
:     O   O   O
:    O O O O O O O  (rendering as fountain of coins)
:
:
:   2:  [ 1 2 1 2 3 1 ]
:
:     o
:  o oo
: oooooo
:
:           O
:      O   O O
:     O O O O O O
:
:
:   3:  [ 1 2 3 1 2 1 ]
:
:   o
:  oo o
: oooooo
:
:       O
:      O O   O
:     O O O O O O
:
:
:   4:  [ 1 2 3 4 ]
:
:    o
:   oo
:  ooo
: oooo
:
:         O
:        O O
:       O O O
:      O O O O
:
		

Crossrefs

Cf. A005169 (fountains of coins), A001524 (weakly unimodal fountains of coins).
Cf. A186085 (1-dimensional sandpiles), A227310 (rough sandpiles).
Cf. A023361 (fountains of coins with all valleys at lowest level).

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(
          `if`(i=j, 0, b(n-j, j)), j=1..min(n, i+1)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 11 2014
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[If[i == j, 0, b[n-j, j]], {j, 1, Min[n, i+1]}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 60] (* Jean-François Alcover, Nov 07 2020, after Alois P. Heinz *)
  • Sage
    # translation of the Maple program by Alois P. Heinz
    @CachedFunction
    def F(n, i):
        if n == 0: return 1
        return sum( (i!=j) * F(n-j, j) for j in [1..min(n,i+1)] ) # A238870
    #    return sum( F(n-j, j) for j in [1, min(n,i+1)] ) # A005169
    def a(n): return F(n, 0)
    print([a(n) for n in [0..50]])
    # Joerg Arndt, Mar 20 2014

Formula

a(n) ~ c / r^n, where r = 0.733216317061133379740342579187365700397652443391231594... and c = 0.172010618097928709454463097802313209201440229976513439... . - Vaclav Kotesovec, Feb 17 2017

A291874 Expansion of 1 - x/(1 - x^3/(1 - x^5/(1 - x^7/(1 - x^9/(1 - ... - x^(2*k-1)/(1 - ...)))))), a continued fraction.

Original entry on oeis.org

1, -1, 0, 0, -1, 0, 0, -1, 0, -1, -1, 0, -2, -1, -1, -3, -2, -3, -4, -4, -6, -7, -8, -11, -13, -16, -20, -24, -31, -37, -46, -58, -70, -88, -108, -133, -167, -204, -252, -315, -386, -479, -594, -731, -909, -1122, -1386, -1720, -2124, -2628, -3254, -4022, -4980
Offset: 0

Views

Author

Seiichi Manyama, Sep 04 2017

Keywords

Crossrefs

Cf. A049346, A143951, A227310, A291148 (similar sequence).

Formula

Convolution inverse of A143951.
a(n) = -A227310(n) for n > 0.

A364039 Triangle read by rows: T(n,k) is the number of integer compositions of n with first part k and differences between neighboring parts in {-1,1}.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 1, 0, 2, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 3, 2, 0, 0, 0, 0, 1, 0, 3, 2, 1, 2, 1, 0, 0, 0, 1, 0, 2, 3, 2, 1, 0, 0, 0, 0, 0, 1, 0, 3, 4, 3, 1, 1, 1, 0, 0, 0, 0, 1, 0, 4, 4, 4, 2, 1, 0, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

John Tyler Rascoe, Aug 06 2023

Keywords

Examples

			Triangle begins:
  1;
  0, 1;
  0, 0, 1;
  0, 1, 1, 1;
  0, 1, 0, 0, 1;
  0, 0, 2, 1, 0, 1;
  0, 2, 1, 1, 0, 0, 1;
  0, 1, 1, 1, 1, 0, 0, 1;
  0, 1, 3, 2, 0, 0, 0, 0, 1;
  0, 3, 2, 1, 2, 1, 0, 0, 0, 1;
  0, 2, 3, 2, 1, 0, 0, 0, 0, 0, 1;
  ...
For n = 6 there are a total of 5 compositions:
  T(6,1) = 2: (123), (1212)
  T(6,2) = 1: (2121)
  T(6,3) = 1: (321)
  T(6,6) = 1: (6)
		

Crossrefs

Cf. A291905 (column k=1), A173258 (row sums).

Programs

  • Maple
    T:= proc(n, i) option remember; `if`(n<1 or i<1, 0,
         `if`(n=i, 1, add(T(n-i, i+j), j=[-1, 1])))
        end: T(0$2):=1:
    seq(seq(T(n, k), k=0..n), n=0..14);  # Alois P. Heinz, Aug 08 2023
  • Python
    def A364039_rowlist(row_max):
        A = []
        for n in range(0,row_max+1):
            A.append([])
            for k in range(0,n+1):
                z = 0
                if n==k: z += 1
                elif k > 1 and k-1 <= n-k: z += A[n-k][k-1]
                if k+1 <= n-k and k != 0: z += A[n-k][k+1]
                A[n].append(z)
            print(A[n])
    A364039_rowlist(12)

Formula

T(n,n) = 1.
T(n,k) = T(n-k,k+1) + T(n-k,k-1) for 0 < k < n.
T(n,k) = 0 for n < k.
T(n,0) = 0 for 0 < n.

A239928 Expansion of F(x^2, x) where F(x,y) is the g.f. of A239927.

Original entry on oeis.org

1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 2, 0, 1, 3, 1, 1, 4, 3, 2, 5, 6, 4, 6, 10, 8, 9, 15, 15, 15, 22, 26, 26, 33, 43, 45, 52, 69, 76, 85, 109, 127, 141, 173, 209, 235, 278, 340, 390, 452, 550, 643, 742, 890, 1054, 1221, 1445, 1720, 2007, 2356, 2803, 3291, 3853, 4568, 5385, 6309, 7450, 8800, 10330, 12164, 14372, 16905, 19879
Offset: 0

Views

Author

Joerg Arndt, Mar 29 2014

Keywords

Comments

What does this sequence count?

Crossrefs

Cf. A000108 (F(1, x)), A143951 (F(x, 1)), A005169 (F(x, x), with interlaced zeros), A227310 (F(x, x^2)).

Programs

  • PARI
    N=66; x='x+O('x^N);
    F(x, y, d=0)=if (d>N, 1, 1 / (1-x*y * F(x, x^2*y, d+1) ) );
    Vec( F(x^2, x) )

Formula

G.f.: 1/(1 - x^3/(1 - x^7/(1 - x^11/(1 - x^15/(1 - x^19/(1 - x^23/( ... ))))))).
Showing 1-10 of 13 results. Next