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.

A291680 Number T(n,k) of permutations p of [n] such that in 0p the largest up-jump equals k and no down-jump is larger than 2; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

This page as a plain text file.
%I A291680 #28 Aug 30 2022 22:16:34
%S A291680 1,0,1,0,1,1,0,1,3,2,0,1,9,8,4,0,1,25,36,20,10,0,1,71,156,108,58,26,0,
%T A291680 1,205,666,586,340,170,74,0,1,607,2860,3098,2014,1078,528,218,0,1,
%U A291680 1833,12336,16230,11888,6772,3550,1672,672,0,1,5635,53518,85150,69274,42366,23284,11840,5454,2126
%N A291680 Number T(n,k) of permutations p of [n] such that in 0p the largest up-jump equals k and no down-jump is larger than 2; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
%C A291680 An up-jump j occurs at position i in p if p_{i} > p_{i-1} and j is the index of p_i in the increasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are larger than p_{i-1}. A down-jump j occurs at position i in p if p_{i} < p_{i-1} and j is the index of p_i in the decreasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are smaller than p_{i-1}. First index in the lists is 1 here.
%H A291680 Alois P. Heinz, <a href="/A291680/b291680.txt">Rows n = 0..140, flattened</a>
%F A291680 T(n,n) = A206464(n-1) for n>0.
%F A291680 Sum_{k=0..n} T(n,k) = A264868(n+1).
%e A291680 T(4,1) = 1: 1234.
%e A291680 T(4,2) = 9: 1243, 1324, 1342, 2134, 2143, 2314, 2341, 2413, 2431.
%e A291680 T(4,3) = 8: 1423, 1432, 3124, 3142, 3214, 3241, 3412, 3421.
%e A291680 T(4,4) = 4: 4213, 4231, 4312, 4321.
%e A291680 T(5,5) = 10: 53124, 53142, 53214, 53241, 53412, 53421, 54213, 54231, 54312, 54321.
%e A291680 Triangle T(n,k) begins:
%e A291680   1;
%e A291680   0, 1;
%e A291680   0, 1,   1;
%e A291680   0, 1,   3,    2;
%e A291680   0, 1,   9,    8,    4;
%e A291680   0, 1,  25,   36,   20,   10;
%e A291680   0, 1,  71,  156,  108,   58,   26;
%e A291680   0, 1, 205,  666,  586,  340,  170,  74;
%e A291680   0, 1, 607, 2860, 3098, 2014, 1078, 528, 218;
%e A291680   ...
%p A291680 b:= proc(u, o, k) option remember; `if`(u+o=0, 1,
%p A291680       add(b(u-j, o+j-1, k), j=1..min(2, u))+
%p A291680       add(b(u+j-1, o-j, k), j=1..min(k, o)))
%p A291680     end:
%p A291680 T:= (n, k)-> b(0, n, k)-`if`(k=0, 0, b(0, n, k-1)):
%p A291680 seq(seq(T(n, k), k=0..n), n=0..12);
%t A291680 b[u_, o_, k_] := b[u, o, k] = If[u+o == 0, 1, Sum[b[u-j, o+j-1, k], {j, 1, Min[2, u]}] + Sum[b[u+j-1, o-j, k], {j, 1, Min[k, o]}]];
%t A291680 T[n_, k_] := b[0, n, k] - If[k == 0, 0, b[0, n, k-1]];
%t A291680 Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, May 29 2019, after _Alois P. Heinz_ *)
%o A291680 (Python)
%o A291680 from sympy.core.cache import cacheit
%o A291680 @cacheit
%o A291680 def b(u, o, k): return 1 if u + o==0 else sum([b(u - j, o + j - 1, k) for j in range(1, min(2, u) + 1)]) + sum([b(u + j - 1, o - j, k) for j in range(1, min(k, o) + 1)])
%o A291680 def T(n, k): return b(0, n, k) - (0 if k==0 else b(0, n, k - 1))
%o A291680 for n in range(13): print([T(n, k) for k in range(n + 1)]) # _Indranil Ghosh_, Aug 30 2017
%Y A291680 Columns k=0-10 give: A000007, A057427, A291683, A321110, A321111, A321112, A321113, A321114, A321115, A321116, A321117.
%Y A291680 T(2n,n) gives A320290.
%Y A291680 Cf. A203717, A206464, A264868.
%K A291680 nonn,tabl
%O A291680 0,9
%A A291680 _Alois P. Heinz_, Aug 29 2017