[go: up one dir, main page]

login
Number of walks within N^2 (the first quadrant of Z^2) starting at (0,0), ending on the vertical axis and consisting of n steps taken from {(-1, -1), (-1, 0), (-1, 1), (0, -1), (1, -1), (1, 0)}.
1

%I #10 Dec 04 2016 13:57:04

%S 1,0,2,1,12,13,106,184,1167,2749,14976,43184,214494,709375,3334182,

%T 12111401,55172493,213825895,958512287,3886970215,17308095926,

%U 72488219249,322457272822,1382555862308,6164246110975,26897094736460,120411455688784,532534766552745,2395778998202593,10709328780143584

%N Number of walks within N^2 (the first quadrant of Z^2) starting at (0,0), ending on the vertical axis and consisting of n steps taken from {(-1, -1), (-1, 0), (-1, 1), (0, -1), (1, -1), (1, 0)}.

%H Alois P. Heinz, <a href="/A151508/b151508.txt">Table of n, a(n) for n = 0..440</a>

%H M. Bousquet-Mélou and M. Mishna, 2008. Walks with small steps in the quarter plane, <a href="http://arxiv.org/abs/0810.4387">ArXiv 0810.4387</a>.

%p b:= proc(n, x, y) option remember; `if` (n<0 or x<0 or y<0 or n<x, 0, `if` (n=0, `if` (x=0, 1, 0), add (b(n-1, x+d[1], y+d[2]), d=[[-1, -1], [-1, 0], [-1, 1], [0, -1], [1, -1], [1, 0]]))) end: a:= n-> b(n, 0, 0):

%p seq (a(n), n=0..30); # _Alois P. Heinz_, Jul 02 2011

%t aux[i_Integer, j_Integer, n_Integer] := Which[Min[i, j, n] < 0 || Max[i, j] > n, 0, n == 0, KroneckerDelta[i, j, n], True, aux[i, j, n] = aux[-1 + i, j, -1 + n] + aux[-1 + i, 1 + j, -1 + n] + aux[i, 1 + j, -1 + n] + aux[1 + i, -1 + j, -1 + n] + aux[1 + i, j, -1 + n] + aux[1 + i, 1 + j, -1 + n]]; Table[Sum[aux[0, k, n], {k, 0, n}], {n, 0, 25}]

%K nonn,walk

%O 0,3

%A _Manuel Kauers_, Nov 18 2008