login
Number of paths starting at {3}^n to a border position where one component equals 0 using steps that decrement one component by 1.
2

%I #19 Mar 29 2017 12:10:49

%S 0,1,20,543,22096,1304045,106478916,11545342795,1608000044288,

%T 280061940550041,59677171216017940,15278632095285640631,

%U 4628964787172536267920,1638318264614752659427333,669895681115518466689138436,313418973409285344224352078435

%N Number of paths starting at {3}^n to a border position where one component equals 0 using steps that decrement one component by 1.

%H Alois P. Heinz, <a href="/A210486/b210486.txt">Table of n, a(n) for n = 0..237</a>

%F a(n) ~ sqrt(Pi) * 2^(n+1) * n^(2*n+3/2) / exp(2*n-1). - _Vaclav Kotesovec_, Sep 02 2014

%e a(1) = 1: [3, 2, 1, 0].

%e a(2) = 20: [33, 23, 13, 03], [33, 23, 13, 12, 02], [33, 23, 13, 12, 11, 01], [33, 23, 13, 12, 11, 10], [33, 23, 22, 12, 02], [33, 23, 22, 12, 11, 01], [33, 23, 22, 12, 11, 10], [33, 23, 22, 21, 11, 01], [33, 23, 22, 21, 11, 10], [33, 23, 22, 21, 20], [33, 32, 22, 12, 02], [33, 32, 22, 12, 11, 01], [33, 32, 22, 12, 11, 10], [33, 32, 22, 21, 11, 01], [33, 32, 22, 21, 11, 10], [33, 32, 22, 21, 20], [33, 32, 31, 21, 11, 01], [33, 32, 31, 21, 11, 10], [33, 32, 31, 21, 20], [33, 32, 31, 30].

%p a:= proc(n) option remember; `if`(n<3, [0, 1, 20][n+1],

%p ((n-1)*(n-2)*(n+1)*a(n-3) -(n-1)*(3*n^2-2*n-4)*a(n-2)

%p +(2*n+1)*(n^2-n+2)*a(n-1)) / (n-1))

%p end:

%p seq(a(n), n=0..20); # _Alois P. Heinz_, Jan 23 2013

%t a[n_] := a[n] = If[n<3, {0, 1, 20}[[n+1]], ((n-1)*(n-2)*(n+1)*a[n-3] - (n-1)*(3*n^2 - 2*n - 4)*a[n-2] + (2*n+1)*(n^2 - n + 2)*a[n-1]) / (n-1)];

%t Table[a[n], {n, 0, 20}] (* _Jean-François Alcover_, Mar 29 2017, after _Alois P. Heinz_ *)

%Y Row n=3 of A210472.

%K nonn,walk

%O 0,3

%A _Alois P. Heinz_, Jan 23 2013