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

A329665 Number of meanders of length n with Motzkin-steps avoiding the consecutive steps UD, HH and DU.

Original entry on oeis.org

1, 2, 3, 6, 11, 20, 38, 72, 136, 260, 499, 958, 1847, 3572, 6917, 13422, 26097, 50808, 99049, 193354, 377857, 739148, 1447292, 2836316, 5562774, 10918180, 21444029, 42143986, 82874681, 163060540, 320996342, 632211192, 1245727488, 2455674532, 4842782497, 9554018554, 18855375593, 37224944572
Offset: 0

Views

Author

Valerie Roitner, Nov 19 2019

Keywords

Comments

The Motzkin step set is U=(1,1), H=(1,0) and D=(1,-1). A meander is a path starting at (0,0) and never crossing the x-axis, i.e., staying at nonnegative altitude.

Examples

			a(3)=6 as one has 6 meanders of length 3, namely: UUU, UUH, UHU, UHD, HUU, HUH.
		

Crossrefs

Cf. A308435 (avoiding UD and DU), A329666 (avoiding UU and HH).
Cf. A329664.

Formula

G.f.: ((-t-1)*sqrt(4*t^4-4*t^3+t^2-2*t+1)-2*t^3-3*t^2+1)/(4*t^3-2*t^2).

A378809 Triangle read by rows: T(n,k) is the number of peak and valleyless Motzkin meanders of length n with k horizontal steps.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 3, 1, 1, 5, 9, 4, 1, 1, 7, 15, 16, 5, 1, 1, 8, 27, 34, 25, 6, 1, 1, 10, 37, 76, 65, 36, 7, 1, 1, 11, 55, 124, 175, 111, 49, 8, 1, 1, 13, 69, 216, 335, 351, 175, 64, 9, 1, 1, 14, 93, 309, 675, 776, 637, 260, 81, 10, 1
Offset: 0

Views

Author

John Tyler Rascoe, Dec 08 2024

Keywords

Comments

Motzkin meanders are lattice paths starting at (0,0) with steps Up (0,1), Horizontal (1,0), and Down (0,-1) that stay weakly above the x-axis. Peak and valleyless Motzkin meanders avoid UD and DU.

Examples

			The triangle begins
   k=0   1   2   3   4   5   6   7
 n=0 1;
 n=1 1,  1;
 n=2 1,  2,  1;
 n=3 1,  4,  3,  1;
 n=4 1,  5,  9,  4,  1;
 n=5 1,  7, 15, 16,  5,  1;
 n=6 1,  8, 27, 34, 25,  6,  1;
 n=7 1, 10, 37, 76, 65, 36,  7,  1;
 ...
T(3,0) = 1: UUU.
T(3,1) = 4: UUH, UHU, UHD, HUU.
T(3,2) = 3: UHH, HHU, HUH.
T(3,3) = 1: HHH.
		

Crossrefs

Cf. column k=1 A001651, A005773, A088855, column k=2 A247643, row sums A308435, A378810.

Programs

  • PARI
    A088855(n,k) = {binomial(floor((n-1)/2), floor((k-1)/2))*binomial(ceil((n-1)/2),ceil((k-1)/2))}
    A_xy(N) = {my(x='x+O('x^N), h = sum(n=0,N, (1/(1-y*x)^(n+1)) * (if(n<1,1,0) + sum(k=1,n, A088855(n,k)*x^(n+k-1)*(y^(k-1)) )) )); for(n=0,N-1,print(Vecrev(polcoeff(h,n))))}
    A_xy(10)

Formula

G.f.: Sum_{n>=0} 1/(1-y*x)^(n+1) * ([n=0] + Sum_{k=1..n} A088855(n,k)*x^(n+k-1)*y^(k-1)).

A378810 Number of horizontal steps in all peak and valleyless Motzkin meanders of length n.

Original entry on oeis.org

0, 1, 4, 13, 39, 110, 300, 801, 2106, 5473, 14097, 36056, 91697, 232108, 585212, 1470557, 3684682, 9209417, 22967446, 57167993, 142051519, 352427720, 873157093, 2160579740, 5340150100, 13185150903, 32523933395, 80156852042, 197391001215, 485723767342
Offset: 0

Views

Author

John Tyler Rascoe, Dec 08 2024

Keywords

Comments

Motzkin meanders are lattice paths starting at (0,0) with steps Up (0,1), Horizontal (1,0), and Down (0,-1) that stay weakly above the x-axis. Peak and valleyless Motzkin meanders avoid UD and DU.

Examples

			For n = 3 we have meanders, UUU, UUH, UHU, UHD, HUU, UHH, HHU, HUH, HHH; giving a total of a(3) = 13 H steps.
		

Crossrefs

Programs

  • PARI
    A088855(n,k) = {binomial(floor((n-1)/2), floor((k-1)/2))*binomial(ceil((n-1)/2),ceil((k-1)/2))}
    A_xy(N) = {my(x='x+O('x^N), h = sum(n=0,N, (1/(1-y*x)^(n+1)) * (if(n<1,1,0) + sum(k=1,n, A088855(n,k)*x^(n+k-1)*(y^(k-1)) )) )); h}
    P_xy(N) = Pol(A_xy(N), {x})
    A_x(N) = {my(px = deriv(P_xy(N),y), y=1); Vecrev(eval(px))}
    A_x(20)

Formula

a(n) = Sum_{k=1..n} A378809(n,k)*k.
Showing 1-3 of 3 results.