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 A086856 #25 May 17 2025 05:54:23 %S A086856 1,0,1,0,2,1,1,5,5,1,7,20,24,8,1,45,115,128,60,11,1,323,790,835,444, %T A086856 113,14,1,2621,6217,6423,3599,1099,183,17,1,23811,55160,56410,32484, %U A086856 11060,2224,270,20,1,239653,545135,554306,325322,118484,27152,3950,374,23,1,2648395 %N A086856 Triangle read by rows: T(n,k) = one-half number of permutations of length n with exactly k rising or falling successions, for n >= 1, 0 <= k <= n-1. T(1,0) = 1 by convention. %C A086856 (1/2) times number of permutations of 1, 2, ..., n such that exactly k of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1). %D A086856 F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263. %H A086856 Alois P. Heinz, <a href="/A086856/b086856.txt">Rows n = 1..141, flattened</a> %H A086856 J. Riordan, <a href="http://dx.doi.org/10.1214/aoms/1177700181">A recurrence for permutations without rising or falling successions</a>, Ann. Math. Statist. 36 (1965), 708-710. %e A086856 Triangle T(n,k) begins: %e A086856 1; %e A086856 0, 1; %e A086856 0, 2, 1; %e A086856 1, 5, 5, 1; %e A086856 7, 20, 24, 8, 1; %e A086856 45, 115, 128, 60, 11, 1; %e A086856 323, 790, 835, 444, 113, 14, 1; %e A086856 ... %p A086856 S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2] %p A086856 [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2) %p A086856 -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4))) %p A086856 end: %p A086856 T:= (n, k)-> ceil(coeff(S(n), t, k)/2): %p A086856 seq(seq(T(n, k), k=0..n-1), n=1..10); # _Alois P. Heinz_, Jan 11 2013 %t A086856 S[n_] := S[n] = If[n < 4, {1, 1, 2*t, 4*t+2*t^2}[[n+1]], Expand[(n+1-t)*S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4]]]; T[n_, k_] := Ceiling[Coefficient[S[n], t, k]/2]; Table[Table[T[n, k], {k, 0, n-1}], {n, 1, 11}] // Flatten (* _Jean-François Alcover_, Jan 14 2014, translated from _Alois P. Heinz_'s Maple code *) %Y A086856 Columns give A001266 (see also A002464), A000130, A000349, A001267, A001268. %Y A086856 Triangle in A001100 divided by 2 (except for T(1, 0)). A010028 transposed. %Y A086856 Row sums give A001710. %K A086856 tabl,nonn %O A086856 1,5 %A A086856 _N. J. A. Sloane_, Aug 19 2003