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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A185286 Triangle T(n,k) is the number of nonnegative walks of n steps with step sizes 1 and 2, starting at 0 and ending at k 3

%I #30 Aug 20 2022 10:50:29

%S 1,0,1,1,2,1,1,2,1,2,5,6,3,3,3,1,11,11,13,17,13,7,6,4,1,24,41,52,44,

%T 43,40,25,14,10,5,1,93,120,152,176,161,126,107,80,45,25,15,6,1,272,

%U 421,550,559,561,524,412,303,227,146,77,41,21,7,1,971,1381,1813,2056,2045,1835,1615,1309,938,648,435,251,126,63,28,8,1

%N Triangle T(n,k) is the number of nonnegative walks of n steps with step sizes 1 and 2, starting at 0 and ending at k

%C Equivalently, the number of paths from (0,0) to (n,k) using steps of the form (1,2),(1,1),(1,-1) or (1,-2) and staying on or above the x-axis.

%C It appears that A047002 gives the row sums of this triangle.

%H Robert Israel, <a href="/A185286/b185286.txt">Table of n, a(n) for n = 0..10200</a>

%e The table starts:

%e 1

%e 0,1,1

%e 2,1,1,2,1

%e 2,5,6,3,3,3,1

%p T:= proc(n,k) option remember;

%p if k < 0 or k > 2*n then return 0 fi;

%p procname(n-1,k-2)+procname(n-1,k-1)+procname(n-1,k+1)+procname(n-1,k+2)

%p end proc:

%p T(0,0):= 1:

%p for nn from 0 to 10 do

%p seq(T(nn,k),k=0..2*nn)

%p od; # _Robert Israel_, Dec 19 2017

%t T[n_, k_] := T[n, k] = If[k < 0 || k > 2n, 0, T[n-1, k-2] + T[n-1, k-1] + T[n-1, k+1] + T[n-1, k+2]];

%t T[0, 0] = 1;

%t Table[T[n, k], {n, 0, 10}, {k, 0, 2n}] // Flatten (* _Jean-François Alcover_, Aug 19 2022, after _Robert Israel_ *)

%o (PARI) flip(v)=vector(#v,i,v[#v+1-i])

%o ar(n)={local(p);p=1;

%o for(k=1,n,p*=1+x+x^3+x^4;p=(p-polcoeff(p,0)-polcoeff(p,1)*x)/x^2);

%o flip(Vec(p))}

%Y Columns k=0..2 are A187430, A055113, A296619.

%Y Cf. A005408(row lengths), A047002(apparently row sums).

%K nonn,walk,tabf

%O 0,5

%A _Franklin T. Adams-Watters_, Mar 10 2011

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 April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)