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!)
A328345 Number of n-step walks on cubic lattice starting at (0,0,0), ending at (floor(n/3), floor((n+1)/3), floor((n+2)/3)) and using steps (0,0,1), (0,1,0), (1,0,0), (-1,1,1), (1,-1,1), and (1,1,-1). 3
1, 1, 4, 21, 88, 440, 2385, 11781, 62832, 352128, 1842240, 10132320, 57775905, 311810785, 1746140396, 10060071021, 55367204256, 313747490784, 1820016119376, 10152658848528, 58015193420160, 338183208699840, 1905152077559808, 10954624445968896, 64089909936535329 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
These walks are not restricted to the first (nonnegative) octant.
LINKS
Wikipedia, Lattice path
EXAMPLE
a(2) = 4: [(0,0,0),(1,0,0),(0,1,1)], [(0,0,0),(0,1,0),(0,1,1)], [(0,0,0),(0,0,1),(0,1,1)], [(0,0,0),(-1,1,1),(0,1,1)].
MAPLE
b:= proc(l) option remember; `if`(l[-1]=0, 1, (r-> add(add(
add(`if`(i+j+k=1, (h-> `if`(add(t, t=h)<0, 0, b(h)))(
sort(l-[i, j, k])), 0), k=r), j=r), i=r))([$-1..1]))
end:
a:= n-> b([floor((n+i)/3)$i=0..2]):
seq(a(n), n=0..24);
MATHEMATICA
b[l_] := b[l] = If[Last[l] == 0, 1, Sum[If[i + j + k == 1, Function[h, If[Total[h] < 0, 0, b[h]]][Sort[l - {i, j, k}]], 0], {i, {-1, 0, 1}}, {j, {-1, 0, 1}}, {k, {-1, 0, 1}}]];
a[n_] := b[Table[Floor[(n + i)/3], {i, 0, 2}]];
a /@ Range[0, 24] (* Jean-François Alcover, May 12 2020, after Maple *)
CROSSREFS
Sequence in context: A277794 A292126 A174797 * A371309 A220574 A231377
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Oct 13 2019
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 March 29 09:44 EDT 2024. Contains 371268 sequences. (Running on oeis4.)