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 A104345 #22 Apr 01 2024 12:44:34 %S A104345 1,1,1,1,2,1,2,3,3,2,5,8,6,8,5,16,25,20,20,25,16,61,96,75,80,75,96,61, %T A104345 272,427,336,350,350,336,427,272,1385,2176,1708,1792,1750,1792,1708, %U A104345 2176,1385,7936,12465,9792,10248,10080,10080,10248,9792,12465,7936 %N A104345 Triangle read by rows: T(n,k) is the number of alternating permutations on [n+1] with 1 in position k+1, 0<=k<=n. %H A104345 Alois P. Heinz, <a href="/A104345/b104345.txt">Rows n = 0..150, flattened</a> %F A104345 The mixed o.g.f./e.g.f. is Sum_{k=0..n} T(n, k)*x^n/n!*y^k = (sec(x) + tan(x))*(sec(x*y) + tan(x*y)). %F A104345 T(n,k) = binomial(n,k)*A000111(k)*A000111(n-k). - _Alois P. Heinz_, Apr 25 2023 %e A104345 Table begins %e A104345 \ k..0....1....2....3....4.... %e A104345 n %e A104345 0 |..1 %e A104345 1 |..1....1 %e A104345 2 |..1....2....1 %e A104345 3 |..2....3....3....2 %e A104345 4 |..5....8....6....8....5 %e A104345 5 |.16...25...20...20...25...16 %e A104345 6 |.61...96...75...80...75...96...61 %e A104345 7 |272..427..336..350..350..336..427..272 %e A104345 For example, T(3,1) counts 2143, 3142, 4132 - the alternating permutations on [4] with 1 in position 2. %p A104345 b:= proc(u, o) option remember; `if`(u+o=0, 1, %p A104345 add(b(o-1+j, u-j), j=1..u)) %p A104345 end: %p A104345 T:= (n, k)-> binomial(n, k)*b(k, 0)*b(n-k, 0): %p A104345 seq(seq(T(n, k), k=0..n), n=0..10); # _Alois P. Heinz_, Apr 25 2023 %t A104345 b[u_, o_] := b[u, o] = If[u+o == 0, 1, Sum[b[o-1+j, u-j], {j, 1, u}]]; %t A104345 T[n_, k_] := Binomial[n, k]*b[k, 0]*b[n-k, 0]; %t A104345 Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* _Jean-François Alcover_, Apr 01 2024, after _Alois P. Heinz_ *) %Y A104345 Cf. A104346. Row sums are A001250; column k=0 and main diagonal are the up-down numbers (A000111); column k=1 is A065619. %Y A104345 T(2n,n) gives A362581. %K A104345 nonn,tabl %O A104345 0,5 %A A104345 _David Callan_, Mar 02 2005