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-4 of 4 results.

A199915 Triangle read by rows: T(n,k) is the number of n-step paths from (0,0) to (0,k) that stay in the first quadrant (but may touch the axes) consisting of steps (1,0), (0,1), (0,-1) and (-1,1).

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 1, 2, 3, 1, 2, 7, 5, 6, 1, 7, 10, 21, 14, 10, 1, 10, 38, 48, 51, 35, 15, 1, 38, 89, 135, 168, 120, 76, 21, 1, 89, 229, 441, 458, 474, 281, 147, 28, 1, 229, 752, 1121, 1604, 1475, 1188, 637, 260, 36, 1, 752, 1873, 3692, 4772, 5100, 4329, 2800, 1366, 429, 45, 1
Offset: 0

Views

Author

Alois P. Heinz, Nov 11 2011

Keywords

Examples

			T(4,2) = 5: ((1,0),(1,0),(-1,1),(-1,1)); ((1,0),(-1,1),(1,0),(-1,1)); ((0,1),(0,1),(0,1),(0,-1)); ((0,1),(0,1),(0,-1),(0,1)); ((0,1),(0,-1),(0,1),(0,1)).
Triangle begins:
   1;
   0,  1;
   1,  1,  1;
   1,  2,  3,  1;
   2,  7,  5,  6,  1;
   7, 10, 21, 14, 10,  1;
  10, 38, 48, 51, 35, 15,  1;
		

Crossrefs

Cf. A151346 (columns k=0, 1), A000217(n) = T(n+1,n), A151412 (row sums).
T(2n,n) gives A317782.
Cf. A306814.

Programs

  • Maple
    b:= proc(n, k, x, y) option remember;
         `if`(n<0 or x<0 or y<0 or n b(n, k, 0, 0):
    seq(seq(T(n, k), k=0..n), n=0..12);
  • Mathematica
    b[n_, k_, x_, y_] := b[n, k, x, y] = If[n<0 || x<0 || y<0 || nJean-François Alcover, Jan 19 2015, after Alois P. Heinz *)

A151346 Number of walks within N^2 (the first quadrant of Z^2) starting and ending at (0,0) and consisting of n steps taken from {(-1, 0), (-1, 1), (0, -1), (1, 0)}.

Original entry on oeis.org

1, 0, 1, 1, 2, 7, 10, 38, 89, 229, 752, 1873, 6009, 17746, 51970, 168199, 503489, 1609327, 5131184, 16183314, 53017947, 170708648, 559207257, 1846295302, 6075728984, 20284263554, 67649481468, 226890912838, 765669449228, 2585600921015, 8785174853897, 29918390234278, 102190450691351, 350429638975797
Offset: 0

Views

Author

Manuel Kauers, Nov 18 2008

Keywords

Crossrefs

Column k=0 of A199915 and of A306814.

Programs

  • Mathematica
    aux[i_Integer, j_Integer, n_Integer] := Which[Min[i, j, n] < 0 || Max[i, j] > n, 0, n == 0, KroneckerDelta[i, j, n], True, aux[i, j, n] = aux[-1 + i, j, -1 + n] + aux[i, 1 + j, -1 + n] + aux[1 + i, -1 + j, -1 + n] + aux[1 + i, j, -1 + n]]; Table[aux[0, 0, n], {n, 0, 25}]

A306813 Number of 2n-step paths from (0,0) to (0,n) that stay in the first quadrant (but may touch the axes) consisting of steps (-1,0), (0,1), (0,-1) and (1,-1).

Original entry on oeis.org

1, 0, 3, 10, 20, 237, 770, 3944, 28635, 112360, 744084, 4381083, 21579779, 143815322, 801165187, 4578481584, 29176623983, 165772480380, 1013147794546, 6259309820475, 36974951346176, 230752749518819, 1413352914731005, 8618746801792237, 53986291171211635
Offset: 0

Views

Author

Alois P. Heinz, Mar 11 2019

Keywords

Examples

			a(0) = 1: [(0,0)].
a(2) = 3:
  [(0,0), (0,1), (0,0), (0,1), (0,2)],
  [(0,0), (0,1), (0,2), (0,1), (0,2)],
  [(0,0), (0,1), (0,2), (0,3), (0,2)].
a(3) = 10:
  [(0,0), (0,1), (1,0), (1,1), (1,2), (1,3), (0,3)],
  [(0,0), (0,1), (0,2), (1,1), (1,2), (1,3), (0,3)],
  [(0,0), (0,1), (0,2), (0,3), (1,2), (1,3), (0,3)],
  [(0,0), (0,1), (0,2), (0,3), (0,4), (1,3), (0,3)],
  [(0,0), (0,1), (1,0), (1,1), (1,2), (0,2), (0,3)],
  [(0,0), (0,1), (0,2), (1,1), (1,2), (0,2), (0,3)],
  [(0,0), (0,1), (0,2), (0,3), (1,2), (0,2), (0,3)],
  [(0,0), (0,1), (1,0), (1,1), (0,1), (0,2), (0,3)],
  [(0,0), (0,1), (0,2), (1,1), (0,1), (0,2), (0,3)],
  [(0,0), (0,1), (1,0), (0,0), (0,1), (0,2), (0,3)].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, x, y) option remember; `if`(min(n, x, y, n-x-y)<0, 0,
          `if`(n=0, 1, add(b(n-1, x-d[1], y-d[2]),
           d=[[-1, 0], [0, 1], [0, -1], [1, -1]])))
        end:
    a:= n-> b(2*n, 0, n):
    seq(a(n), n=0..30);
  • Mathematica
    b[n_, x_, y_] := b[n, x, y] = If[Min[n, x, y, n - x - y] < 0, 0, If[n == 0, 1, Sum[b[n - 1, x - d[[1]], y - d[[2]]], {d, {{-1, 0}, {0, 1}, {0, -1}, {1, -1}}}]]];
    a[n_] := b[2n, 0, n];
    a /@ Range[0, 30] (* Jean-François Alcover, May 13 2020, after Maple *)

Formula

a(n) = A306814(2n,n).
a(n) ~ c * d^n / n^2, where d = 6.7004802541941947450873... and c = 0.5171899701803656646... - Vaclav Kotesovec, Apr 13 2019

A151404 Number of walks within N^2 (the first quadrant of Z^2) starting at (0,0), ending on the vertical axis and consisting of n steps taken from {(-1, 0), (0, -1), (0, 1), (1, -1)}.

Original entry on oeis.org

1, 1, 2, 4, 9, 23, 58, 160, 447, 1280, 3799, 11329, 34648, 107194, 335052, 1062809, 3392928, 10944072, 35576811, 116369798, 383517144, 1270497711, 4232708951, 14174190320, 47670133454, 161055621043, 546226400383, 1859448826545, 6352403850949, 21770237036258, 74841611960045, 258025290079584, 891972398224757
Offset: 0

Views

Author

Manuel Kauers, Nov 18 2008

Keywords

Crossrefs

Row sums of A306814.

Programs

  • Mathematica
    aux[i_Integer, j_Integer, n_Integer] := Which[Min[i, j, n] < 0 || Max[i, j] > n, 0, n == 0, KroneckerDelta[i, j, n], True, aux[i, j, n] = aux[-1 + i, 1 + j, -1 + n] + aux[i, -1 + j, -1 + n] + aux[i, 1 + j, -1 + n] + aux[1 + i, j, -1 + n]]; Table[Sum[aux[0, k, n], {k, 0, n}], {n, 0, 25}]
Showing 1-4 of 4 results.