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 A177263 #11 May 22 2024 00:48:00 %S A177263 1,0,2,1,1,4,4,5,5,10,18,22,23,23,34,96,114,118,119,119,154,600,696, %T A177263 714,718,719,719,874,4320,4920,5016,5034,5038,5039,5039,5914,35280, %U A177263 39600,40200,40296,40314,40318,40319,40319,46234,322560,357840,362160,362760,362856,362874,362878,362879,362879,409114 %N A177263 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k as the last entry in the first block (1<=k<=n). %C A177263 A block of a permutation is a maximal sequence of consecutive integers which appear in consecutive positions. For example, the permutation 45123867 has 4 blocks: 45, 123, 8, and 67. %C A177263 Mirror image of A177264. %H A177263 G. C. Greubel, <a href="/A177263/b177263.txt">Rows n = 1..50 of the triangle, flattened</a> %H A177263 A. N. Myers, <a href="https://doi.org/10.1006/jcta.2002.3279">Counting permutations by their rigid patterns</a>, J. Combin. Theory, Series A, Vol. 99, No. 2 (2002), pp. 345-357. %F A177263 T(n, k) = (n-1)! - (n-k-1)! if k <= n-1, otherwise T(n, n) = 0!+1!+...+(n-1)! = A003422(n). %F A177263 T(n, 1) = A094304(n). %F A177263 Sum_{k=1..n} T(n, k) = A000142(n) (row sums). %F A177263 T(n, k) = A177264(n, n-k+1) (mirror image). %e A177263 T(4,2)=5 because we have 12-4-3, 2-1-34, 2-1-4-3, 2-4-1-3, and 2-4-3-1 (the blocks are separated by dashes). %e A177263 Triangle starts: %e A177263 1; %e A177263 0, 2; %e A177263 1, 1, 4; %e A177263 4, 5, 5, 10; %e A177263 18, 22, 23, 23, 34; %e A177263 96, 114, 118, 119, 119, 154; %e A177263 600, 696, 714, 718, 719, 719, 874; %e A177263 4320, 4920, 5016, 5034, 5038, 5039, 5039, 5914; %p A177263 T := proc (n, k) if k <= n-1 then factorial(n-1)-factorial(n-k-1) elif k = n then sum(factorial(j), j = 0 .. n-1) else 0 end if end proc: for n to 10 do seq(T(n, k), k = 1 .. n) end do; # yields sequence in triangular form %t A177263 A003422[n_]:= Sum[j!, {j,0,n-1}]; %t A177263 T[n_, k_]:= If[k==n, A003422[n], (n-1)! -(n-k-1)!]; %t A177263 Table[T[n,k], {n,12}, {k,n}]//Flatten (* _G. C. Greubel_, May 19 2024 *) %o A177263 (Magma) %o A177263 A003422:= func< n | (&+[Factorial(j): j in [0..n-1]]) >; %o A177263 A177263:= func< n,k | k eq n select A003422(n) else Factorial(n-1) - Factorial(n-k-1) >; %o A177263 [A177263(n,k): k in [1..n], n in [1..12]]; // _G. C. Greubel_, May 19 2024 %o A177263 (SageMath) %o A177263 def A003422(n): return sum(factorial(j) for j in range(n)) %o A177263 def A177263(n,k): return A003422(n) if k==n else factorial(n-1) - factorial(n-k-1) %o A177263 flatten([[A177263(n,k) for k in range(1,n+1)] for n in range(1,13)]) # _G. C. Greubel_, May 19 2024 %Y A177263 Cf. A000142, A003422, A094304, A177264. %K A177263 nonn,tabl %O A177263 1,3 %A A177263 _Emeric Deutsch_, May 16 2010