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.

A322782 Number of lattice paths from {2}^n to {0}^n using steps that decrement one component by 1 such that for each point (p_1,p_2,...,p_n) we have abs(p_{i}-p_{i+1}) <= 1 and abs(p_{1}-p_{n}) <= 1.

This page as a plain text file.
%I A322782 #45 May 13 2020 09:51:55
%S A322782 1,1,4,36,720,23400,1123200,74440800,6509318400,725829724800,
%T A322782 100511918784000,16922530756454400,3404178048774758400,
%U A322782 806369627582929612800,222159405758654317363200,70435689828806256514560000,25463217531292911649057996800,10411540182139235537714555289600
%N A322782 Number of lattice paths from {2}^n to {0}^n using steps that decrement one component by 1 such that for each point (p_1,p_2,...,p_n) we have abs(p_{i}-p_{i+1}) <= 1 and abs(p_{1}-p_{n}) <= 1.
%F A322782 a(n) = n * A318191(2,n) for n > 0. - _Alois P. Heinz_, Jan 09 2019
%p A322782 b:= proc(l) option remember; (n-> `if`(n<2 or max(l[])=0, 1,
%p A322782       add(`if`(l[i]=0 or 1<abs(l[`if`(i=1, 0, i)-1]-l[i]+1)
%p A322782                       or 1<abs(l[`if`(i=n, 0, i)+1]-l[i]+1), 0,
%p A322782         b(subsop(i=l[i]-1, l))), i=1..n)))(nops(l))
%p A322782     end:
%p A322782 a:= n-> b([2$n]):
%p A322782 seq(a(n), n=0..12);  # _Alois P. Heinz_, Jan 05 2019
%t A322782 b[l_] := b[l] = With[{n = Length[l]}, If[n < 2 || Max[l ] == 0, 1, Sum[If[ l[[i]] == 0 || 1 < Abs[l[[If[i == 1, 0, i] - 1]] - l[[i]] + 1] || 1 < Abs[l[[If[i == n, 0, i] + 1]] - l[[i]] + 1], 0, b[ReplacePart[l, i -> l[[i]] - 1]]], {i, n}]]];
%t A322782 a[n_] := b[Table[2, {n}]];
%t A322782 a /@ Range[0, 12] (* _Jean-François Alcover_, May 13 2020, after _Alois P. Heinz_ *)
%Y A322782 Cf. A227656, A318191.
%K A322782 nonn,walk
%O A322782 0,3
%A A322782 _Woong-Gi Jung_, Dec 26 2018
%E A322782 More terms from _Alois P. Heinz_, Dec 30 2018