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 A317166 #15 Sep 01 2021 16:07:56 %S A317166 1,1,1,5,7,27,241,505,1975,10241,188743,460545,2323679,10836141, %T A317166 85023209,2734858573,8010483015,45714797671,243112435345, %U A317166 1632532938001,15831051353773,892173483721887,2978105991739613,19855526019022967,113487352591708591 %N A317166 Number of permutations of [n] with distinct lengths of increasing runs. %H A317166 Alois P. Heinz, <a href="/A317166/b317166.txt">Table of n, a(n) for n = 0..66</a> %F A317166 a(A000217(n)) = A317165(n). %p A317166 g:= (n, s)-> `if`(n in s, 0, 1): %p A317166 b:= proc(u, o, t, s) option remember; `if`(u+o=0, g(t, s), %p A317166 `if`(g(t, s)=1, add(b(u-j, o+j-1, 1, s union {t}) %p A317166 , j=1..u), 0)+ add(b(u+j-1, o-j, t+1, s), j=1..o)) %p A317166 end: %p A317166 a:= n-> b(n, 0$2, {}): %p A317166 seq(a(n), n=0..24); %t A317166 g[n_, s_] := If[MemberQ[s, n], 0, 1]; %t A317166 b[u_, o_, t_, s_] := b[u, o, t, s] = If[u + o == 0, g[t, s], %t A317166 If[g[t, s] == 1, Sum[b[u - j, o + j - 1, 1, s ~Union~ {t}], %t A317166 {j, u}], 0] + Sum[b[u + j - 1, o - j, t + 1, s], {j, o}]]; %t A317166 a[n_] := b[n, 0, 0, {}]; %t A317166 Table[a[n], {n, 0, 24}] (* _Jean-François Alcover_, Sep 01 2021, after _Alois P. Heinz_ *) %Y A317166 Cf. A000217, A007838, A317165. %K A317166 nonn %O A317166 0,4 %A A317166 _Alois P. Heinz_, Jul 23 2018