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.

A227655 Number A(n,k) of lattice paths from {n}^k to {0}^k using steps that decrement one component by 1 such that for each point (p_1,p_2,...,p_k) we have abs(p_{i}-p_{i+1}) <= 1; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 6, 4, 1, 1, 1, 24, 44, 8, 1, 1, 1, 120, 896, 320, 16, 1, 1, 1, 720, 29392, 33904, 2328, 32, 1, 1, 1, 5040, 1413792, 7453320, 1281696, 16936, 64, 1, 1, 1, 40320, 93770800, 2940381648, 1897242448, 48447504, 123208, 128, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Jul 19 2013

Keywords

Examples

			A(2,2) = 2^2 = 4:
        (1,2)       (0,1)
       /     \     /     \
  (2,2)       (1,1)       (0,0)
       \     /     \     /
        (2,1)       (1,0)
Square array A(n,k) begins:
  1, 1,  1,     1,        1,            1, ...
  1, 1,  2,     6,       24,          120, ...
  1, 1,  4,    44,      896,        29392, ...
  1, 1,  8,   320,    33904,      7453320, ...
  1, 1, 16,  2328,  1281696,   1897242448, ...
  1, 1, 32, 16936, 48447504, 482913033152, ...
		

Crossrefs

Main diagonal gives A227673.

Programs

  • Maple
    b:= proc(l) option remember; `if`({l[]}={0}, 1, add(
          `if`(l[i]=0 or i>1 and 1 `if`(k<2, 1, b([n$k])):
    seq(seq(A(n, d-n), n=0..d), d=0..10);
  • Mathematica
    b[l_] := b[l] = If[Union[l] == {0}, 1, Sum[If[l[[i]] == 0 || i>1 && 1 < Abs[l[[i-1]] - l[[i]] + 1] || i l[[i]]-1]]], {i, 1, Length[l]}]]; a[n_, k_] := If[k<2, 1, b[Array[n&, k]]]; Table[Table[a[n, d - n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Dec 12 2013, translated from Maple *)