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 A104346 #21 Apr 21 2025 09:41:30 %S A104346 1,1,1,1,2,2,2,3,6,5,5,8,12,20,16,16,25,40,50,80,61,61,96,150,200,240, %T A104346 366,272,272,427,672,875,1120,1281,1904,1385,1385,2176,3416,4480,5600, %U A104346 6832,7616,11080,7936,7936,12465,19584,25620,32256,38430,45696,49860,71424,50521 %N A104346 Triangle read by rows: T(n,k) is the number of alternating max-precedes-min permutations on [n+2] with 1 in position k+2, 0<=k<=n. %H A104346 Alois P. Heinz, <a href="/A104346/b104346.txt">Rows n = 0..150, flattened</a> %F A104346 The mixed e.g.f./o.g.f. is Sum_{k=0..n} T(n, k)*x^n/n!*y^k = (sec(x) + tan(x))*sec(xy)*(sec(xy) + tan(xy)). %F A104346 T(n,k) = binomial(n,k)*A000111(k+1)*A000111(n-k). - _Alois P. Heinz_, Apr 25 2023 %e A104346 Table begins %e A104346 \ k..0....1....2....3....4.... %e A104346 n %e A104346 0 |..1 %e A104346 1 |..1....1 %e A104346 2 |..1....2....2 %e A104346 3 |..2....3....6....5 %e A104346 4 |..5....8...12...20...16 %e A104346 5 |.16...25...40...50...80...61 %e A104346 6 |.61...96..150..200..240..366..272 %e A104346 For example, a(3,1) counts 45132, 35142, 25143---the alternating permutations on [5] with 5 preceding 1 and 1 in position 3. %p A104346 b:= proc(u, o) option remember; `if`(u+o=0, 1, %p A104346 add(b(o-1+j, u-j), j=1..u)) %p A104346 end: %p A104346 T:= (n, k)-> binomial(n, k)*b(k+1, 0)*b(n-k, 0): %p A104346 seq(seq(T(n, k), k=0..n), n=0..10); # _Alois P. Heinz_, Apr 25 2023 %t A104346 b[u_, o_] := b[u, o] = If[u+o == 0, 1, Sum[b[o-1+j, u-j], {j, 1, u}]]; %t A104346 T[n_, k_] := Binomial[n, k]*b[k+1, 0]*b[n-k, 0]; %t A104346 Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* _Jean-François Alcover_, Apr 21 2025, after _Alois P. Heinz_ *) %Y A104346 Cf. A104345. Row sums, column k=0 and main diagonal are all A000111. %K A104346 nonn,tabl %O A104346 0,5 %A A104346 _David Callan_, Mar 02 2005