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.
%I A361651 #23 Dec 06 2023 14:44:03 %S A361651 1,0,1,0,1,2,0,2,3,6,0,5,6,12,24,0,16,20,30,60,120,0,61,80,90,180,360, %T A361651 720,0,272,350,420,630,1260,2520,5040,0,1385,1750,2240,2520,5040, %U A361651 10080,20160,40320,0,7936,10080,13440,15120,22680,45360,90720,181440,362880 %N A361651 Number T(n,k) of permutations p of [n] such that p(i), p(i+k), p(i+2k),... form an up-down sequence for i in [k]; triangle T(n,k), n>=0, 0<=k<=n, read by rows. %C A361651 Number T(n,k) of permutations p of [n] such that p(i) < p(i+k) > p(i+2k) < ... for i <= k. %C A361651 T(n,k) is defined for n,k >= 0. The triangle contains only the terms with k<=n. T(n,k) = n! for k>=n. %H A361651 Alois P. Heinz, <a href="/A361651/b361651.txt">Rows n = 0..150, flattened</a> %e A361651 Triangle T(n,k) begins: %e A361651 1; %e A361651 0, 1; %e A361651 0, 1, 2; %e A361651 0, 2, 3, 6; %e A361651 0, 5, 6, 12, 24; %e A361651 0, 16, 20, 30, 60, 120; %e A361651 0, 61, 80, 90, 180, 360, 720; %e A361651 0, 272, 350, 420, 630, 1260, 2520, 5040; %e A361651 0, 1385, 1750, 2240, 2520, 5040, 10080, 20160, 40320; %e A361651 ... %p A361651 b:= proc(u, o) option remember; `if`(u+o=0, 1, %p A361651 add(b(o-1+j, u-j), j=1..u)) %p A361651 end: %p A361651 T:= (n, k)-> `if`(n=0, 1, `if`(k=0, 0, (l-> mul(b(s, 0), s=l)* %p A361651 combinat[multinomial](n, l[]))([floor((n+i)/k)$i=0..k-1]))): %p A361651 seq(seq(T(n, k), k=0..n), n=0..10); %t A361651 multinomial[n_, k_List] := n!/Times @@ (k!); %t A361651 b[u_, o_] := b[u, o] = If[u+o == 0, 1, Sum[b[o-1+j, u-j], {j, 1, u}]]; %t A361651 T[n_, k_] := If[n == 0, 1, If[k == 0, 0, Function[l, Product[b[s, 0], {s, l}]*multinomial[n, l]][Table[Floor[(n+i)/k], {i, 0, k-1}]]]]; %t A361651 Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* _Jean-François Alcover_, Nov 22 2023, after _Alois P. Heinz_ *) %Y A361651 Columns k=0-3 give: A000007, A000111, A361648, A367336. %Y A361651 Main diagonal gives A000142. %Y A361651 T(2n,n) gives A000680. %Y A361651 Cf. A248686, A333706. %K A361651 nonn,look,tabl %O A361651 0,6 %A A361651 _Alois P. Heinz_, Mar 19 2023