cp's OEIS Frontend

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.

A317132 Number of permutations of [n] whose lengths of increasing runs are factorials.

This page as a plain text file.
%I A317132 #15 Mar 29 2021 08:00:48
%S A317132 1,1,2,5,17,70,350,2029,13495,100813,837647,7652306,76282541,
%T A317132 823684964,9578815164,119346454671,1586149739684,22397700381817,
%U A317132 334879465463998,5285103821004717,87800206978975107,1531533620821692217,27987305231654121046,534688325008397289484
%N A317132 Number of permutations of [n] whose lengths of increasing runs are factorials.
%H A317132 Alois P. Heinz, <a href="/A317132/b317132.txt">Table of n, a(n) for n = 0..400</a>
%F A317132 a(3) = 5: 132, 213, 231, 312, 321.
%F A317132 a(4) = 17: 1324, 1423, 1432, 2143, 2314, 2413, 2431, 3142, 3214, 3241, 3412, 3421, 4132, 4213, 4231, 4312, 4321.
%p A317132 g:= proc(n) local i; 1; for i from 2 do
%p A317132       if n=% then 1; break elif n<% then 0; break fi;
%p A317132       %*i od; g(n):=%
%p A317132     end:
%p A317132 b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
%p A317132       `if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
%p A317132        add(b(u+j-1, o-j, t+1), j=1..o))
%p A317132     end:
%p A317132 a:= n-> `if`(n=0, 1, add(b(j-1, n-j, 1), j=1..n)):
%p A317132 seq(a(n), n=0..27);
%t A317132 g[n_] := g[n] = Module[{i, k = 1}, For[i = 2, True, i++,
%t A317132      If[n == k, k = 1; Break[]]; If[n < k, k = 0; Break[]];
%t A317132      k = k*i]; k];
%t A317132 b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
%t A317132      If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
%t A317132      Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
%t A317132 a[n_] := If[n == 0, 1, Sum[b[j - 1, n - j, 1], {j, 1, n}]];
%t A317132 a /@ Range[0, 27] (* _Jean-François Alcover_, Mar 29 2021~, after _Alois P. Heinz_ *)
%Y A317132 Cf. A000142, A097597, A272603, A317111, A317128, A317129, A317130, A317131, A317448.
%K A317132 nonn
%O A317132 0,3
%A A317132 _Alois P. Heinz_, Jul 21 2018