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.

Showing 1-5 of 5 results.

A346539 a(n) is the number of paths in the Z X Z grid joining (0,0) and (n,n) each of whose steps increases the Euclidean distance to the origin and has coordinates with absolute value at most 1.

Original entry on oeis.org

1, 3, 25, 241, 2545, 28203, 322681, 3776275, 44947503, 542097295, 6607714859, 81247609095, 1006335719467, 12542292874825, 157159924565801, 1978517963096763, 25010881408459855, 317327992746937599, 4039340709637022007, 51569571332132589961, 660140626022179390983
Offset: 0

Views

Author

Keywords

Comments

All terms are odd.

Crossrefs

Main diagonal of A346538.
Column k=2 of A347811.

Programs

  • Maple
    b:= proc(n, k) option remember; `if`([n, k]=[0$2], 1, add(add(
         `if`(i^2+j^2 b(n$2):
    seq(a(n), n=0..23);  # Alois P. Heinz, Sep 12 2021
  • Mathematica
    rodean[{m_, n_}] := Select[ Complement[ Flatten[Table[{m, n} + {s, t}, {s, -1, 1}, {t, -1, 1}], 1] // Union, {{m, n}}], #[[1]]^2 + #[[2]]^2 < m^2 + n^2 &];
    $RecursionLimit=10^6; Clear[T]; T[{0, 0}]=1; T[{m_,n_}]:= T[{m,n}]= Sum[T[rodean[{m,n}][[i]]],{i,Length[rodean[{m, n}]]}]; Table[T[{n,n}],{n, 0,22}]
    (* Second program: *)
    b[n_, k_] := b[n, k] = If[{n, k} == {0, 0}, 1, Sum[Sum[If[i^2 + j^2 < n^2 + k^2, b@@Sort[{i, j}], 0], {j, k-1, k+1}], {i, n-1, n+1}]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Nov 03 2021, after Alois P. Heinz *)

Formula

a(n) ~ c * d^n / n^(3/2), where d = 1/6*(19009+153*sqrt(17))^(1/3) + 356/(3*(19009+153*sqrt(17))^(1/3)) + 14/3 = 13.56165398271839628518... and c = 2.3842296614800994817864695565477260682981556338086519... . - Vaclav Kotesovec, Sep 13 2021

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 *)

A347810 Number of n-dimensional lattice walks from {n}^n to {0}^n 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, 1, 25, 2062017739, 255053951339165796439851848897794625
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.

Crossrefs

Main diagonal of A347811.
Cf. A034841.

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$n]):
    seq(a(n), n=0..5);
  • 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[Table[n, {n}]];
    Table[a[n], {n, 0, 5}] (* Jean-François Alcover, Nov 04 2021, after Alois P. Heinz *)

A347812 Number of n-dimensional lattice walks from {2}^n to {0}^n 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, 1, 25, 211075, 1322634996717, 16042961630858858915656, 286729345864079773218271997053157611, 25868451537111690721940670963124809063875212336403319, 3742158706432626794575922563227094346392414743343045621639247710036163317
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.

Crossrefs

Row n=2 of A347811.

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([2$n]):
    seq(a(n), n=0..7);
  • 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[Table[2, {n}]];
    Table[a[n], {n, 0, 7}] (* Jean-François Alcover, Nov 04 2021, after Alois P. Heinz *)

A346840 Number of n-dimensional lattice walks from {1}^n to {0}^n 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, 1, 3, 19, 323, 38716, 32253681, 78267222216, 762698791293515, 37603168183752885658, 9243338412512497704718998, 11335247475355582487279558180986, 68305298969167998414438069494886302081, 1920885596256995709122789811280666218400361901
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(3) = 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

Row n=1 of A347811.

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([1$n]):
    seq(a(n), n=0..10);
  • 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[Table[1, {n}]];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 13}] (* Jean-François Alcover, Nov 04 2021, after Alois P. Heinz *)
Showing 1-5 of 5 results.