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.

A088457 Number of single nodes (exactly one node on that level) for all Motzkin paths of length n.

This page as a plain text file.
%I A088457 #27 Apr 16 2024 18:00:10
%S A088457 1,0,1,2,4,8,18,44,113,296,782,2076,5538,14856,40100,108936,297793,
%T A088457 818832,2263481,6286498,17532707,49077268,137821247,388150322,
%U A088457 1095980561,3101840232,8797579789,25001305410,71179961918,203000438544,579876376729,1658948939262
%N A088457 Number of single nodes (exactly one node on that level) for all Motzkin paths of length n.
%C A088457 A Motzkin path of length n is a sequence [y(0),...,y(n)] such that |y(i)-y(i+1)| <= 1, 0=y(0)=y(n)<=y(i).
%H A088457 Alois P. Heinz, <a href="/A088457/b088457.txt">Table of n, a(n) for n = 0..750</a>
%e A088457 [0,0,0,1,0], [0,0,1,0,0], [0,1,0,0,0], [0,1,2,1,0] are the a(4) = 4 sequences.
%p A088457 b:= proc(x, y, h, c) option remember; `if`(y<0 or y>x, 0,
%p A088457      `if`(x=0, c, add(b(x-1, y-i, max(h, y),
%p A088457      `if`(h=y, 0, `if`(h<y, 1, c))), i=-1..1)))
%p A088457     end:
%p A088457 a:= n-> b(n, 0$2, 1):
%p A088457 seq(a(n), n=0..31);  # _Alois P. Heinz_, Jul 25 2023
%t A088457 b[x_, y_, h_, c_] := b[x, y, h, c] = If[y<0 || y>x, 0, If[x == 0, c, Sum[b[x-1, y-i, Max[h, y], If[h == y, 0, If[h < y, 1, c]]], {i, -1, 1}]]];
%t A088457 a[n_] := b[n, 0, 0, 1];
%t A088457 Table[a[n], {n, 0, 31}] (* _Jean-François Alcover_, Oct 23 2023, after _Alois P. Heinz_ *)
%o A088457 (PARI) {a(n)=local(p0, p1, p2); if(n<0, 0, p1=1; polcoeff(sum(i=0, n, if(p2=(1-x)*p1-x^2*p0, p0=p1; p1=p2; (x^i/p0)^2), x*O(x^n)), n))}
%Y A088457 Cf. A001006, A051485, A152880.
%Y A088457 Column k=1 of A364386 and of A372014.
%K A088457 nonn
%O A088457 0,4
%A A088457 _Michael Somos_, Oct 01 2003
%E A088457 a(30)-a(31) from _Alois P. Heinz_, Jul 21 2023