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.

A328300 Number T(n,k) of n-step walks on cubic lattice starting at (0,0,0), ending at (0,k,n-k), remaining in the first (nonnegative) octant and using steps (0,0,1), (0,1,0), (1,0,0), (-1,1,1), (1,-1,1), and (1,1,-1); triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 7, 1, 1, 15, 26, 15, 1, 1, 31, 82, 82, 31, 1, 1, 63, 237, 343, 237, 63, 1, 1, 127, 651, 1257, 1257, 651, 127, 1, 1, 255, 1730, 4256, 5594, 4256, 1730, 255, 1, 1, 511, 4494, 13669, 22411, 22411, 13669, 4494, 511, 1, 1, 1023, 11485, 42279, 83680, 103730, 83680, 42279, 11485, 1023, 1
Offset: 0

Views

Author

Alois P. Heinz, Oct 11 2019

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  1,   1;
  1,   3,    1;
  1,   7,    7,    1;
  1,  15,   26,   15,    1;
  1,  31,   82,   82,   31,    1;
  1,  63,  237,  343,  237,   63,    1;
  1, 127,  651, 1257, 1257,  651,  127,   1;
  1, 255, 1730, 4256, 5594, 4256, 1730, 255, 1;
  ...
		

Crossrefs

Columns k=0-1 give: A000012, A000225.
Row sums give A328296.
T(2n,n) gives A328269.
T(n,floor(n/2)) gives A328280.

Programs

  • Maple
    b:= proc(l) option remember; `if`(l[-1]=0, 1, (r-> add(
          add(add(`if`(i+j+k=1, (h-> `if`(h[1]<0, 0, b(h)))(
          sort(l-[i, j, k])), 0), k=r), j=r), i=r))([$-1..1]))
        end:
    T:= (n, k)-> b(sort([0, k, n-k])):
    seq(seq(T(n, k), k=0..n), n=0..12);
  • Mathematica
    b[l_List] := b[l] = If[l[[-1]] == 0, 1, Function[r, Sum[Sum[Sum[If[i + j + k == 1, Function[h, If[h[[1]] < 0, 0, b[h]]][Sort[l - {i, j, k}]], 0], {k, r}], {j, r}], {i, r}]][{-1, 0, 1}]];
    T[n_, k_] := b[Sort[{0, k, n - k}]];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 10 2020, after Maple *)

Formula

T(n,k) = T(n,n-k).

A328296 Number of n-step walks on cubic lattice starting at (0,0,0), ending at (0,y,z), remaining in the first (nonnegative) octant and using steps (0,0,1), (0,1,0), (1,0,0), (-1,1,1), (1,-1,1), and (1,1,-1).

Original entry on oeis.org

1, 2, 5, 16, 58, 228, 945, 4072, 18078, 82172, 380666, 1791138, 8537912, 41146988, 200169891, 981705400, 4848820372, 24098703860, 120433164750, 604831645542, 3050979757728, 15451575335362, 78536766518038, 400497435480332, 2048473941706016, 10506489209380466
Offset: 0

Views

Author

Alois P. Heinz, Oct 11 2019

Keywords

Crossrefs

Column k=0 of A328297.
Row sums of A328300.

Programs

  • Maple
    b:= proc(l) option remember; `if`(l[-1]=0, 1, (r-> add(
          add(add(`if`(i+j+k=1, (h-> `if`(h[1]<0, 0, b(h)))(
          sort(l-[i, j, k])), 0), k=r), j=r), i=r))([$-1..1]))
        end:
    a:= n-> add(b(sort([0, j, n-j])), j=0..n):
    seq(a(n), n=0..29);
  • Mathematica
    b[l_] := b[l] = If[Last[l] == 0, 1, Sum[If[i + j + k == 1, Function[h, If[h[[1]] < 0, 0, b[h]]][Sort[l - {i, j, k}]], 0], {i, {-1, 0, 1}}, {j, {-1, 0, 1}}, {k, {-1, 0, 1}}]];
    a[n_] := Sum[b[Sort[{0, j, n  - j}]], {j, 0, n }];
    a /@ Range[0, 29] (* Jean-François Alcover, May 12 2020, after Maple *)

Formula

a(n) is odd <=> n in { A000918 } and n >= 0.

A328299 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)), remaining in the first (nonnegative) octant and using steps (0,0,1), (0,1,0), (1,0,0), (-1,1,1), (1,-1,1), and (1,1,-1).

Original entry on oeis.org

1, 1, 3, 12, 41, 179, 909, 3968, 19680, 106368, 516905, 2717631, 15139485, 77813569, 422589823, 2395441908, 12734635078, 70577595746, 404540380566, 2199035619696, 12356298623126, 71368686011040, 394076753535029, 2236273925952447, 12988459939106601
Offset: 0

Views

Author

Alois P. Heinz, Oct 11 2019

Keywords

Examples

			a(2) = 3: [(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)].
		

Crossrefs

Programs

  • Maple
    b:= proc(l) option remember; `if`(l[-1]=0, 1, (r-> add(
          add(add(`if`(i+j+k=1, (h-> `if`(h[1]<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[h[[1]] < 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 *)

A328295 Number of n-step walks on cubic lattice starting at (0,0,0), remaining in the first (nonnegative) octant and using steps (0,0,1), (0,1,0), (1,0,0), (-1,1,1), (1,-1,1), and (1,1,-1).

Original entry on oeis.org

1, 3, 12, 57, 294, 1590, 8856, 50301, 289590, 1683306, 9853320, 57977922, 342494118, 2029350972, 12052664868, 71715479535, 427347761010, 2549540104944, 15224944518084, 90988367614254, 544115710748898, 3255541325220204, 19486893225315138, 116685749052336714
Offset: 0

Views

Author

Alois P. Heinz, Oct 11 2019

Keywords

Crossrefs

Row sums of A328297.

Programs

  • Maple
    b:= proc(l) option remember; `if`(l[-1]=0, 1, (r-> add(
          add(add(`if`(i+j+k=1, (h-> `if`(h[1]<0, 0, b(h)))(
          sort(l-[i, j, k])), 0), k=r), j=r), i=r))([$-1..1]))
        end:
    a:= n-> add(add(b(sort([i, j, n-i-j])), j=0..n-i), i=0..n):
    seq(a(n), n=0..23);
  • Mathematica
    b[l_] := b[l] = If[Last[l] == 0, 1, Function[r, Sum[If[i + j + k == 1, Function[h, If[h[[1]] < 0, 0, b[h]]][Sort[l - {i, j, k}]], 0], {i, r}, {j, r}, {k, r}]][{-1, 0, 1}]];
    a[n_] := Sum[Sum[b[Sort[{i, j, n - i - j}]], {j, 0, n - i}], {i, 0, n}];
    a /@ Range[0, 23] (* Jean-François Alcover, May 13 2020, after Maple *)

A328427 Number of 2n-step walks on cubic lattice starting at (0,0,0), ending at (n,y,z), remaining in the first (nonnegative) octant and using steps (0,0,1), (0,1,0), (1,0,0), (-1,1,1), (1,-1,1), and (1,1,-1).

Original entry on oeis.org

1, 6, 93, 2040, 52086, 1443898, 42073956, 1266666928, 39005460010, 1220921798726, 38687295919777, 1237507863154364, 39880747868561408, 1292960017095690800, 42125333404129589074, 1378096053159532505284, 45239194620411006084462, 1489461895371375668384236
Offset: 0

Views

Author

Alois P. Heinz, Oct 15 2019

Keywords

Crossrefs

Cf. A328297.

Programs

  • Maple
    b:= proc(l) option remember; `if`(l[-1]=0, 1, (r-> add(
          add(add(`if`(i+j+k=1, (h-> `if`(h[1]<0, 0, b(h)))(
          sort(l-[i, j, k])), 0), k=r), j=r), i=r))([$-1..1]))
        end:
    a:= n-> add(b(sort([n, j, n-j])), j=0..n):
    seq(a(n), n=0..23);
  • Mathematica
    b[l_] := b[l] = If[Last[l] == 0, 1, Function[r, Sum[If[i + j + k == 1, Function[h, If[h[[1]] < 0, 0, b[h]]][Sort[l - {i, j, k}]], 0], {i, r}, {j, r}, {k, r}]][{-1, 0, 1}]];
    a[n_] := Sum[b[Sort[{n, j, n - j}]], {j, 0, n}];
    a /@ Range[0, 23] (* Jean-François Alcover, May 13 2020, after Maple *)

Formula

a(n) = A328297(2n,n).
Showing 1-5 of 5 results.