login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A333679
Sum of the heights of all nonnegative lattice paths from (0,0) to (n,0) such that slopes of adjacent steps differ by at most one, assuming zero slope before and after the paths.
4
0, 0, 0, 1, 3, 8, 20, 53, 137, 375, 1035, 2878, 7988, 22308, 62642, 176692, 499818, 1418228, 4035568, 11512449, 32916181, 94313011, 270757747, 778694171, 2243200705, 6471953522, 18699169766, 54098598824, 156706773404, 454457344755, 1319382151919, 3834346819731
OFFSET
0,5
COMMENTS
The maximal height in all paths of length n is floor(ceil(n/2)^2/4) = A008642(n-3) for n>2.
MAPLE
b:= proc(x, y, t, h) option remember;
`if`(x=0, h, add(b(x-1, y+j, j, max(h, y)),
j=max(t-1, -y)..min(x*(x-1)/2-y, t+1)))
end:
a:= n-> b(n, 0$3):
seq(a(n), n=0..32);
MATHEMATICA
b[x_, y_, t_, h_] := b[x, y, t, h] =
If[x == 0, h, Sum[b[x - 1, y + j, j, Max[h, y]],
{j, Max[t - 1, -y], Min[x(x - 1)/2 - y, t + 1]}]];
a[n_] := b[n, 0, 0, 0];
a /@ Range[0, 32] (* Jean-François Alcover, Apr 26 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 01 2020
STATUS
approved