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 A367336 #21 Apr 22 2025 05:21:39 %S A367336 1,1,2,6,12,30,90,420,2240,13440,84000,577500,4331250,36036000, %T A367336 322882560,3099672576,31513337856,340409701632,3893435962416, %U A367336 47122428697344,600341948743680,8030803773358080,112453396587417600,1646232972560748000,25147419121286426250 %N A367336 Number of permutations p of [n] such that p(i), p(i+3), p(i+6),... form an up-down sequence for i in {1,2,3}. %C A367336 Number of permutations p of [n] such that p(i) < p(i+3) > p(i+6) < ... for i <= 3. %H A367336 Alois P. Heinz, <a href="/A367336/b367336.txt">Table of n, a(n) for n = 0..485</a> %e A367336 a(4) = 12: 1234, 1243, 1324, 1342, 1423, 1432, 2134, 2143, 2314, 2413, 3124, 3214. %e A367336 a(5) = 30: 12345, 12354, 12435, 12453, 12534, 12543, 13245, 13254, 13425, 13524, 14235, 14325, 21345, 21354, 21435, 21453, 21534, 21543, 23145, 23154, 24135, 31245, 31254, 31452, 31542, 32145, 32154, 41253, 41352, 42153. %p A367336 b:= proc(u, o) option remember; %p A367336 `if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u)) %p A367336 end: %p A367336 a:= n-> (l-> combinat[multinomial](n, l[])*mul( %p A367336 b(s, 0), s=l))([floor((n+i)/3)$i=0..2]): %p A367336 seq(a(n), n=0..27); %t A367336 multinomial[n_, k_List] := n!/Times @@ (k!); %t A367336 b[u_, o_] := b[u, o] = If[u+o == 0, 1, Sum[b[o-1+j, u-j], {j, 1, u}]]; %t A367336 a[n_] := Function[l, Product[b[s, 0], {s, l}]*multinomial[n, l]][Table[ Floor[(n+i)/3], {i, 0, 2}]]; %t A367336 Table[a[n], {n, 0, 27}] (* _Jean-François Alcover_, Nov 27 2023, after _Alois P. Heinz_ *) %Y A367336 Column k=3 of A361651. %Y A367336 Cf. A000111, A000142, A022916. %K A367336 nonn %O A367336 0,3 %A A367336 _Alois P. Heinz_, Nov 14 2023