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-4 of 4 results.

A333498 Sum of the heights of all Motzkin paths of length n.

Original entry on oeis.org

0, 0, 1, 3, 9, 25, 70, 196, 552, 1560, 4423, 12573, 35826, 102310, 292786, 839554, 2411945, 6941593, 20011328, 57779038, 167069317, 483739961, 1402413161, 4070537585, 11827842021, 34403798725, 100167396088, 291903951462, 851380987390, 2485175809878
Offset: 0

Views

Author

Alois P. Heinz, Mar 24 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(x, y, h) option remember; `if`(x=0, h, add(
          b(x-1, y+j, max(h, y)), j=-min(1, y)..min(1, x-y-1)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..35);
  • Mathematica
    b[x_, y_, h_] := b[x, y, h] = If[x == 0, h, Sum[b[x - 1, y + j, Max[h, y]], {j, -Min[1, y], Min[1, x - y - 1]}]];
    a[n_] := b[n, 0, 0];
    a /@ Range[0, 35] (* Jean-François Alcover, May 10 2020, after Maple *)

Formula

a(n) = Sum_{k=1..floor(n/2)} k * A097862(n,k).

A129181 Triangle read by rows: T(n,k) is the number of Motzkin paths of length n such that the area between the x-axis and the path is k (n>=0; 0<=k<=floor(n^2/4)).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 1, 4, 6, 4, 3, 2, 1, 1, 5, 10, 10, 8, 7, 5, 3, 1, 1, 1, 6, 15, 20, 19, 18, 16, 12, 8, 6, 3, 2, 1, 1, 7, 21, 35, 40, 41, 41, 36, 29, 23, 18, 12, 9, 5, 3, 1, 1, 1, 8, 28, 56, 76, 86, 93, 92, 83, 72, 62, 50, 40, 30, 22, 14, 10, 6, 3, 2, 1, 1, 9, 36, 84, 133, 168
Offset: 0

Views

Author

Emeric Deutsch, Apr 08 2007

Keywords

Comments

Row n has 1+floor(n^2/4) terms.
Row sums are the Motzkin numbers (A001006).

Examples

			T(5,3) = 4 because we have LULLD, ULLDL, UDULD and ULDUD, where U=(1,1), L=(1,0) and D=(1,-1).
Triangle starts:
00: 1;
01: 1;
02: 1, 1;
03: 1, 2,  1;
04: 1, 3,  3,  1,  1;
05: 1, 4,  6,  4,  3,  2,  1;
06: 1, 5, 10, 10,  8,  7,  5,  3, 1, 1;
07: 1, 6, 15, 20, 19, 18, 16, 12, 8, 6, 3, 2, 1;
...
From _Joerg Arndt_, Apr 19 2014: (Start)
Row n=5 corresponds to the following Motzkin paths (dots denote zeros):
# :   height in path   area    step in path
01:  [ . . . . . . ]     0     0 0 0 0 0
02:  [ . . . . 1 . ]     1     0 0 0 + -
03:  [ . . . 1 . . ]     1     0 0 + - 0
04:  [ . . . 1 1 . ]     2     0 0 + 0 -
05:  [ . . 1 . . . ]     1     0 + - 0 0
06:  [ . . 1 . 1 . ]     2     0 + - + -
07:  [ . . 1 1 . . ]     2     0 + 0 - 0
08:  [ . . 1 1 1 . ]     3     0 + 0 0 -
09:  [ . . 1 2 1 . ]     4     0 + + - -
10:  [ . 1 . . . . ]     1     + - 0 0 0
11:  [ . 1 . . 1 . ]     2     + - 0 + -
12:  [ . 1 . 1 . . ]     2     + - + - 0
13:  [ . 1 . 1 1 . ]     3     + - + 0 -
14:  [ . 1 1 . . . ]     2     + 0 - 0 0
15:  [ . 1 1 . 1 . ]     3     + 0 - + -
16:  [ . 1 1 1 . . ]     3     + 0 0 - 0
17:  [ . 1 1 1 1 . ]     4     + 0 0 0 -
18:  [ . 1 1 2 1 . ]     5     + 0 + - -
19:  [ . 1 2 1 . . ]     4     + + - - 0
20:  [ . 1 2 1 1 . ]     5     + + - 0 -
21:  [ . 1 2 2 1 . ]     6     + + 0 - -
(End)
		

Crossrefs

Antidiagonal sums give A186085(n+1).

Programs

  • Maple
    G:=1/(1-z-t*z^2*g[1]): for i from 1 to 13 do g[i]:=1/(1-t^i*z-t^(2*i+1)*z^2*g[i+1]) od: g[14]:=0: Gser:=simplify(series(G,z=0,13)): for n from 0 to 10 do P[n]:=sort(coeff(Gser,z,n)) od: for n from 0 to 10 do seq(coeff(P[n],t,j),j=0..floor(n^2/4)) od; # yields sequence in triangular form
    # second Maple program
    b:= proc(x, y, k) option remember;
          `if`(x<0 or xx^2, 0,
          `if`(x=0, 1, add(b(x-1, y+i, k-y-i/2), i=-1..1)))
        end:
    T:= (n, k)-> b(n, 0, k):
    seq(seq(T(n, k), k=0..floor(n^2/4)), n=0..12); # Alois P. Heinz, Jun 28 2012
  • Mathematica
    b[x_, y_, k_] := b[x, y, k] = If[x<0 || xx^2, 0, If[x==0, 1, Sum[b[x-1, y+i, k-y-i/2], {i, -1, 1}]]]; T[n_, k_] := b[n, 0, k]; Table[Table[ T[n, k], {k, 0, Floor[n^2/4]}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Mar 24 2015, after Alois P. Heinz *)

Formula

G.f. G(t,z) satisfies G(t,z) = 1 + z*G(t,z) + t*z^2*G(t,t*z)*G(t,z).
Sum_{k>=0} k * T(n,k) = A057585(n).
Sum_{j=0..n} T(n-j,j) = A186085(n+1). - Alois P. Heinz, Jun 25 2023

A367778 a(n) is the sum of the squares of the areas under Motzkin paths of length n.

Original entry on oeis.org

0, 1, 6, 40, 198, 910, 3848, 15492, 59920, 224917, 824074, 2960828, 10466610, 36498195, 125801144, 429284612, 1452174984, 4874940295, 16254780970, 53873727516, 177594715034, 582603630260, 1902860189328, 6190199896600, 20064013907288, 64815504118695, 208739559416878, 670345766842528
Offset: 1

Views

Author

AJ Bu, Nov 29 2023

Keywords

Comments

a(n) is the sum of the squares of the areas under Motzkin paths of length n (nonnegative walks beginning and ending in 0, with jumps -1,0,+1).

Examples

			a(3) = 6 = 1*2^2 + 2*1^2 because there is 1 Motzkin path of length 3 with area 2 and 2 Motzkin paths of length 3 with area 1.
		

Crossrefs

Programs

  • Maple
    G:=((x - 1 + sqrt(-(x + 1)*(3*x - 1)))*(3*sqrt(-(x + 1)*(3*x - 1))*x^4 - 9*x^5 - 14*sqrt(-(x + 1)*(3*x - 1))*x^3 + 15*x^4 + 8*sqrt(-(x + 1)*(3*x - 1))*x^2 + 26*x^3 + 4*sqrt(-(x + 1)*(3*x - 1))*x - 4*x^2 - sqrt(-(x + 1)*(3*x - 1)) - 5*x + 1))/( 4*(x + 1)^3*(3*x - 1)^3*x^2):  Gser:=series(G, x=0, 30): seq(coeff(Gser,x,n), n=1..26);
  • PARI
    seq(n) = {my(w=sqrt((1 + x)*(1 - 3*x) + O(x*x^n))); Vec((1 - x - w)*(w^2*(1 - 3*x - 7*x^2 + 3*x^3) - w*(1 - x)*(1 - 3*x - 11*x^2 + 3*x^3))/(2*w^3*x)^2, -n)} \\ Andrew Howroyd, Jan 07 2024

Formula

G.f.: (1 - x - w)*(w^2*(1 - 3*x - 7*x^2 + 3*x^3) - w*(1 - x)*(1 - 3*x - 11*x^2 + 3*x^3))/(2*w^3*x)^2 where w is sqrt((1 + x)*(1 - 3*x)).
D-finite with recurrence -(n+2)*(37012171*n -222599339)*a(n) +3*(n+1)*(108071243*n -631482704)*a(n-1) +(-512534971*n^2 +2421530181*n +1780794712)*a(n-2) +3*(-641100693*n^2 +4745437175*n -5322233482)*a(n-3) +(4162359143*n^2 -33175360881*n +59296953526)*a(n-4) +3*(1437180249*n^2 -9681487559*n +8357806732)*a(n-5) +9*(-754462425*n^2 +6932112703*n -14939114852)*a(n-6) -27*(218140823*n -693079002)*(n-5)*a(n-7)=0. - R. J. Mathar, Jan 11 2024

A367779 a(n) is the sum of the cubed areas under Motzkin paths of length n.

Original entry on oeis.org

0, 0, 1, 10, 118, 818, 5092, 27564, 137836, 644836, 2870189, 12266918, 50724954, 204046142, 801892081, 3089123960, 11696423536, 43623049688, 160547844283, 583940294930, 2101624362838, 7492542382034, 26484322064854, 92891831844644, 323514376584988, 1119432296516028, 3850521166068067
Offset: 0

Views

Author

AJ Bu, Nov 29 2023

Keywords

Comments

a(n) is the sum of the cubed areas under Motzkin paths of length n (nonnegative walks beginning and ending in 0, with jumps -1, 0, +1).

Crossrefs

Programs

  • Maple
    G:= ((x - 1 + sqrt(-3*x^2 - 2*x + 1))*(27*sqrt(-3*x^2 - 2*x + 1)*x^6 + 27*x^7 - 108*sqrt(-3*x^2 - 2*x + 1)*x^5 - 171*x^6 + 135*sqrt(-3*x^2 - 2*x + 1)*x^4 + 375*x^5 + 46*sqrt(-3*x^2 - 2*x + 1)*x^3 - 173*x^4 + 9*sqrt(-3*x^2 - 2*x + 1)*x^2 - 49*x^3 - 6*sqrt(-3*x^2 - 2*x + 1)*x - 15*x^2 + sqrt(-3*x^2 - 2*x + 1) + 7*x - 1))/( 4*(3*x^2 + 2*x - 1)^4*x^2):
      Gser:=series(G, x=0, 30):
      seq(coeff(Gser, x, n), n=0..26);

Formula

G.f.: ((x-1+sqrt(-3*x^2 - 2*x+1))*(27*sqrt(-3*x^2 - 2*x + 1)*x^6 + 27*x^7 - 108*sqrt(-3*x^2 - 2*x + 1)*x^5 - 171*x^6 + 135*sqrt(-3*x^2 - 2*x + 1)*x^4 + 375*x^5 + 46*sqrt(-3*x^2 - 2*x + 1)*x^3 - 173*x^4 + 9*sqrt(-3*x^2 - 2*x + 1)*x^2 - 49*x^3 - 6*sqrt(-3*x^2 - 2*x + 1)*x - 15*x^2 + sqrt(-3*x^2 - 2*x + 1) + 7*x - 1))/( 4*(3*x^2 + 2*x - 1)^4*x^2).
D-finite with recurrence -(n+2)*(208042818093439115480236359*n^2 +3624614398456581514732421474*n -17721487814464945136538072251)*a(n) -(n+1)*(208042818093439115480236359*n^2 -41719745257135632687267408740*n +158505784032262104018605336605)*a(n-1) +(-13360215714657466655169907343*n^3 +118659841630751948460172231402*n^2 -123756458774685279991682146443*n -283543805031439122184609156016)*a(n-2) +(118036702571591403784149448443*n^3 -1525771475215968386687916047321*n^2 +4755582466160131138387124654521*n -4142597862823901093548746996315)*a(n-3) +(-176751907767445269010514270775*n^3 +2983064124441697753911146724326*n^2 -14709907226642052191037550511297*n +13263795264370017511434242152362)*a(n-4) +(-272197576813729306989090076649*n^3 +1341914897255725751921825738923*n^2 +2457351063573329630789375171733*n -7112280079323183611739056078799)*a(n-5) +3*(140641582500711132344919452197*n^3 -2013691622157844732623667550670*n^2 +6061316376844627496454860983745*n -5394852349759561206535461042300)*a(n-6) +9*(31431304934630931225275881933*n^3 -175191266960061764283712600119*n^2 +116063361456271209040196525891*n +17631740228382449873765632167)*a(n-7) -54*(n-6) *(1909106552786855250861701283*n^2 -11218051836500565448490163661*n +11426761828186879119687838319)*a(n-8)=0. - R. J. Mathar, Mar 30 2024
Showing 1-4 of 4 results.