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
1, 1, 2, 5, 17, 70, 350, 2029, 13495, 100813, 837647, 7652306, 76282541, 823684964, 9578815164, 119346454671, 1586149739684, 22397700381817, 334879465463998, 5285103821004717, 87800206978975107, 1531533620821692217, 27987305231654121046, 534688325008397289484 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(3) = 5: 132, 213, 231, 312, 321.
a(4) = 17: 1324, 1423, 1432, 2143, 2314, 2413, 2431, 3142, 3214, 3241, 3412, 3421, 4132, 4213, 4231, 4312, 4321.
MAPLE
g:= proc(n) local i; 1; for i from 2 do
if n=% then 1; break elif n<% then 0; break fi;
%*i od; g(n):=%
end:
b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
`if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
add(b(u+j-1, o-j, t+1), j=1..o))
end:
a:= n-> `if`(n=0, 1, add(b(j-1, n-j, 1), j=1..n)):
seq(a(n), n=0..27);
MATHEMATICA
g[n_] := g[n] = Module[{i, k = 1}, For[i = 2, True, i++,
If[n == k, k = 1; Break[]]; If[n < k, k = 0; Break[]];
k = k*i]; k];
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
a[n_] := If[n == 0, 1, Sum[b[j - 1, n - j, 1], {j, 1, n}]];
a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021~, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A263642 A263682 A049774 * A335926 A139402 A143382
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 21 2018
STATUS
approved

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 July 26 10:50 EDT 2024. Contains 374632 sequences. (Running on oeis4.)