(Translated by https://www.hiragana.jp/)
A317132 - OEIS
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A317132 Number of permutations of [n] whose lengths of increasing runs are factorials. 7

%I #15 Mar 29 2021 08:00:48

%S 1,1,2,5,17,70,350,2029,13495,100813,837647,7652306,76282541,

%T 823684964,9578815164,119346454671,1586149739684,22397700381817,

%U 334879465463998,5285103821004717,87800206978975107,1531533620821692217,27987305231654121046,534688325008397289484

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

%H Alois P. Heinz, <a href="/A317132/b317132.txt">Table of n, a(n) for n = 0..400</a>

%F a(3) = 5: 132, 213, 231, 312, 321.

%F a(4) = 17: 1324, 1423, 1432, 2143, 2314, 2413, 2431, 3142, 3214, 3241, 3412, 3421, 4132, 4213, 4231, 4312, 4321.

%p g:= proc(n) local i; 1; for i from 2 do

%p if n=% then 1; break elif n<% then 0; break fi;

%p %*i od; g(n):=%

%p end:

%p b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),

%p `if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+

%p add(b(u+j-1, o-j, t+1), j=1..o))

%p end:

%p a:= n-> `if`(n=0, 1, add(b(j-1, n-j, 1), j=1..n)):

%p seq(a(n), n=0..27);

%t g[n_] := g[n] = Module[{i, k = 1}, For[i = 2, True, i++,

%t If[n == k, k = 1; Break[]]; If[n < k, k = 0; Break[]];

%t k = k*i]; k];

%t b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],

%t If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +

%t Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];

%t a[n_] := If[n == 0, 1, Sum[b[j - 1, n - j, 1], {j, 1, n}]];

%t a /@ Range[0, 27] (* _Jean-François Alcover_, Mar 29 2021~, after _Alois P. Heinz_ *)

%Y Cf. A000142, A097597, A272603, A317111, A317128, A317129, A317130, A317131, A317448.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Jul 21 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 24 05:16 EDT 2024. Contains 373661 sequences. (Running on oeis4.)