login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

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 60th year, we have over 367,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A199915 Triangle read by rows: T(n,k) is the number of n-step paths from (0,0) to (0,k) that stay in the first quadrant (but may touch the axes) consisting of steps (1,0), (0,1), (0,-1) and (-1,1). 5
1, 0, 1, 1, 1, 1, 1, 2, 3, 1, 2, 7, 5, 6, 1, 7, 10, 21, 14, 10, 1, 10, 38, 48, 51, 35, 15, 1, 38, 89, 135, 168, 120, 76, 21, 1, 89, 229, 441, 458, 474, 281, 147, 28, 1, 229, 752, 1121, 1604, 1475, 1188, 637, 260, 36, 1, 752, 1873, 3692, 4772, 5100, 4329, 2800, 1366, 429, 45, 1 (list; table; graph; refs; listen; history; text; internal format)
OFFSET
0,8
LINKS
EXAMPLE
T(4,2) = 5: ((1,0),(1,0),(-1,1),(-1,1)); ((1,0),(-1,1),(1,0),(-1,1)); ((0,1),(0,1),(0,1),(0,-1)); ((0,1),(0,1),(0,-1),(0,1)); ((0,1),(0,-1),(0,1),(0,1)).
Triangle begins:
1;
0, 1;
1, 1, 1;
1, 2, 3, 1;
2, 7, 5, 6, 1;
7, 10, 21, 14, 10, 1;
10, 38, 48, 51, 35, 15, 1;
MAPLE
b:= proc(n, k, x, y) option remember;
`if`(n<0 or x<0 or y<0 or n<x or n<abs(k-y), 0,
`if`(n=0, 1, add (b(n-1, k, x+d[1], y+d[2]),
d=[[1, 0], [0, 1], [0, -1], [-1, 1]])))
end:
T:= (n, k)-> b(n, k, 0, 0):
seq(seq(T(n, k), k=0..n), n=0..12);
MATHEMATICA
b[n_, k_, x_, y_] := b[n, k, x, y] = If[n<0 || x<0 || y<0 || n<x || n<Abs[k-y], 0, If[n == 0, 1, Sum[b[n-1, k, x+d[[1]], y+d[[2]]], {d, {{1, 0}, {0, 1}, {0, -1}, {-1, 1}}}]]]; T[n_, k_] := b[n, k, 0, 0]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Jan 19 2015, after Alois P. Heinz *)
CROSSREFS
Cf. A151346 (columns k=0, 1), A000217(n) = T(n+1,n), A151412 (row sums).
T(2n,n) gives A317782.
Cf. A306814.
Sequence in context: A205699 A109200 A158909 * A209557 A183759 A101477
KEYWORD
nonn,walk,tabl
AUTHOR
Alois P. Heinz, Nov 11 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 3 22:01 EST 2023. Contains 367540 sequences. (Running on oeis4.)