cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A347813 Number of cubic lattice walks from (n,n,n) to (0,0,0) using steps that decrease the Euclidean distance to the origin and that change each coordinate by at most 1.

Original entry on oeis.org

1, 19, 211075, 2062017739, 32191353922714, 977270269148852086, 29618256217540107753856, 1041952262234097478667071246, 43960391382107369608617444946360, 2007170356703297211447385988052335644, 99624394337129260265907069889802324849302
Offset: 0

Views

Author

Alois P. Heinz, Sep 14 2021

Keywords

Comments

Lattice points may have negative coordinates, and different walks may differ in length. All walks are self-avoiding.

Examples

			a(1) = 19:
  ((1,1,1), (0,0,0)),
  ((1,1,1), (0,0,1), (0,0,0)),
  ((1,1,1), (0,1,0), (0,0,0)),
  ((1,1,1), (0,1,1), (0,0,0)),
  ((1,1,1), (1,0,0), (0,0,0)),
  ((1,1,1), (1,0,1), (0,0,0)),
  ((1,1,1), (1,1,0), (0,0,0)),
  ((1,1,1), (0,1,1), (-1,0,0), (0,0,0)),
  ((1,1,1), (0,1,1), (0,0,1), (0,0,0)),
  ((1,1,1), (0,1,1), (0,1,0), (0,0,0)),
  ((1,1,1), (0,1,1), (1,0,0), (0,0,0)),
  ((1,1,1), (1,0,1), (0,-1,0), (0,0,0)),
  ((1,1,1), (1,0,1), (0,0,1), (0,0,0)),
  ((1,1,1), (1,0,1), (0,1,0), (0,0,0)),
  ((1,1,1), (1,0,1), (1,0,0), (0,0,0)),
  ((1,1,1), (1,1,0), (0,0,-1), (0,0,0)),
  ((1,1,1), (1,1,0), (0,0,1), (0,0,0)),
  ((1,1,1), (1,1,0), (0,1,0), (0,0,0)),
  ((1,1,1), (1,1,0), (1,0,0), (0,0,0)).
		

Crossrefs

Column k=3 of A347811.
Cf. A348201.

Programs

  • Maple
    s:= proc(n) option remember;
         `if`(n=0, [[]], map(x-> seq([x[], i], i=-1..1), s(n-1)))
        end:
    b:= proc(l) option remember; (n-> `if`(l=[0$n], 1, add((h-> `if`(
          add(i^2, i=h) b([n$3]):
    seq(a(n), n=0..12);
  • Mathematica
    s[n_] := s[n] = If[n == 0, {{}}, Sequence @@ Table[Append[#, i], {i, -1, 1}]& /@ s[n-1]];
    b[l_List] := b[l] = With[{n = Length[l]}, If[l == Table[0, {n}], 1, Sum[With[{h = l+x}, If[h.h < l.l, b[Sort[h]], 0]], {x, s[n]}]]];
    a[n_] := b[{n, n, n}];
    Table[a[n], {n, 0, 12}] (* Jean-François Alcover, Nov 04 2021, after Alois P. Heinz *)