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.

A335588 Number of n-step n-dimensional nonnegative lattice walks starting at the origin and using steps that increment all components or decrement one component by 1.

Original entry on oeis.org

1, 1, 3, 13, 81, 686, 7525, 102173, 1655241, 31119382, 665254791, 15927737772, 422179410829, 12275253219828, 388591800808471, 13309116622983421, 490515662121994785, 19362705183912628838, 815258217524407553989, 36479395828632610279316, 1729012534789121191076601
Offset: 0

Views

Author

Alois P. Heinz, Jan 26 2021

Keywords

Examples

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

Crossrefs

Main diagonal of A335570.

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, 1, b(n-1, map(x-> x+1, l))+add(
         `if`(l[i]>0, b(n-1, sort(subsop(i=l[i]-1, l))), 0), i=1..nops(l)))
        end:
    a:= n-> b(n, [0$n]):
    seq(a(n), n=0..23);
  • Mathematica
    b[n_, l_] := b[n, l] = If[n == 0, 1, b[n - 1, l + 1] + Sum[If[l[[i]] > 0, b[n - 1, Sort[ReplacePart[l, i -> l[[i]] - 1]]], 0], {i, 1, Length[l]}]];
    a[n_] := b[n, Table[0, {n}]];
    a /@ Range[0, 23] (* Jean-François Alcover, Jan 29 2021, after Alois P. Heinz *)

Formula

a(n) = A335570(n,n).
a(n) == 1 (mod n) for n >= 2.