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”).

Number of n-step paths from (0,0) to (1,0) where all diagonal, vertical and horizontal steps are allowed.
1

%I #33 Aug 29 2021 04:31:38

%S 0,1,4,27,168,1140,7800,54845,390320,2815344,20494320,150442908,

%T 1111782672,8264558016,61743361680,463306724595,3489942222624,

%U 26378657835816,199991245341888,1520403553182800,11587257160313120,88506896001503616,677426230547667744

%N Number of n-step paths from (0,0) to (1,0) where all diagonal, vertical and horizontal steps are allowed.

%C Equivalent to which linear combinations of (-1,-1), (-1,0), (-1,1), (0,1), (0,-1), (1,1), (1,0), (1,-1) equal (1,0).

%H Alois P. Heinz, <a href="/A218274/b218274.txt">Table of n, a(n) for n = 0..1000</a>

%e a(2) = 4 because we have [0,1]+[1,-1], [1,1]+[0,-1] and the y-negatives [0,-1]+[1,1], [1,-1]+[0,1].

%p a:= proc(n) option remember; `if`(n<3, n^2,

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

%p +4*(n-1)*(27*n^3-84*n^2+80*n-21) *a(n-2)

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

%p end:

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

%t a[n_] := a[n] = If[n<3, n^2,

%t ((9n^4-9n^3-8n^2+4n) a[n-1] +

%t 4(n-1)(27n^3-84n^2+80n-21) a[n-2] +

%t 32(3n-1)(n-1)(n-2)^2 a[n-3]) /

%t (n(n-1)(n+1)(3n-4))];

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

%o (Maxima)

%o a[0]:0$

%o a[1]:1$

%o a[2]:4$

%o a[n]:= ((9*n^4-9*n^3-8*n^2+4*n)*a[n-1]+4*(n-1)*(27*n^3-84*n^2+80*n-21)*a[n-2]+32*(3*n-1)*(n-1)*(n-2)^2 *a[n-3])/(n*(n-1)*(n+1)*(3*n-4))$

%o A218274(n):=a[n]$

%o makelist(A218274(n),n,0,30); /* _Martin Ettl_, Nov 03 2012 */

%Y Cf. A094061.

%K nonn,easy

%O 0,3

%A _Jon Perry_, Nov 01 2012

%E More terms from _Joerg Arndt_, Nov 02 2012