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 A177248 #37 Apr 28 2024 11:38:12 %S A177248 1,1,1,1,4,2,19,4,1,99,18,3,611,99,9,1,4376,612,48,4,35621,4376,306, %T A177248 16,1,324965,35620,2190,100,5,3285269,324965,17810,730,25,1,36462924, %U A177248 3285270,162480,5940,180,6,440840359,36462924,1642635,54160,1485,36,1 %N A177248 Triangle read by rows: T(n,k) is the number of permutations of [n] having k adjacent transpositions (0 <= k <= floor(n/2)). An adjacent transposition is a cycle of the form (i, i+1). %C A177248 Row n contains 1 + floor(n/2) entries. %C A177248 Sum of entries in row n = n! (A000142). %H A177248 Seiichi Manyama, <a href="/A177248/b177248.txt">Rows n = 0..200, flattened</a> %H A177248 R. A. Brualdi and E. Deutsch, <a href="http://arxiv.org/abs/1005.0781">Adjacent q-cycles in permutations</a>, arXiv:1005.0781 [math.CO], 2010. %F A177248 T(n, k) = Sum_{j=0..floor(n/2)} (-1)^(k+j)*binomial(j,k)*(n-j)!/j!. %F A177248 T(n, 0) = A177249(n). %F A177248 Sum_{k=0..floor(n/2)} k*T(n,k) = (n-1)! (n >= 2). %F A177248 G.f. of column k: (1/k!) * Sum_{j>=k} j! * x^(j+k) / (1+x^2)^(j+1). - _Seiichi Manyama_, Feb 24 2024 %e A177248 T(5,2)=3 because we have (12)(34)(5), (12)(3)(45), and (1)(23)(45). %e A177248 Triangle starts: %e A177248 1; %e A177248 1; %e A177248 1, 1; %e A177248 4, 2; %e A177248 19, 4, 1; %e A177248 99, 18, 3; %e A177248 611, 99, 9, 1; %p A177248 T := proc (n, k) options operator, arrow: sum((-1)^(k+j)*binomial(j, k)*factorial(n-j)/factorial(j), j = 0 .. floor((1/2)*n)) end proc: for n from 0 to 12 do seq(T(n, k), k = 0 .. floor((1/2)*n)) end do; # yields sequence in triangular form %t A177248 T[n_, k_] := Sum[(-1)^(k + j)*Binomial[j, k]*(n - j)!/j!, {j, 0, n/2}]; %t A177248 Table[T[n, k], {n, 0, 12}, {k, 0, n/2}] // Flatten (* _Jean-François Alcover_, Nov 20 2017 *) %o A177248 (PARI) T(n, k) = sum(j=0, n\2, (-1)^(k+j)*binomial(j,k)*(n-j)!/j!); %o A177248 tabf(nn) = for (n=0, nn, for (k=0, n\2, print1(T(n,k), ", ")); print); \\ _Michel Marcus_, Nov 21 2017 %o A177248 (Magma) %o A177248 F:=Factorial; %o A177248 A177248:= func< n,k | (&+[(-1)^j*F(n-k-j)/(F(k)*F(j)): j in [0..Floor((n-2*k)/2)]]) >; %o A177248 [A177248(n,k): k in [0..Floor(n/2)], n in [0..16]]; // _G. C. Greubel_, Apr 28 2024 %o A177248 (SageMath) %o A177248 f=factorial; %o A177248 def A177248(n,k): return sum((-1)^j*f(n-k-j)/(f(k)*f(j)) for j in range(1+(n-2*k)//2)) %o A177248 flatten([[A177248(n,k) for k in range(1+n//2)] for n in range(17)]) # _G. C. Greubel_, Apr 28 2024 %Y A177248 Columns k=0..3 give A177249, A370524, A370426, A370529. %Y A177248 Cf. A000166, A008290, A177249, A177250, A177251, A177252, A177253. %Y A177248 Cf. A000142 (row sums). %K A177248 nonn,tabf %O A177248 0,5 %A A177248 _Emeric Deutsch_, May 07 2010