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!)
A324621 Number of permutations p of [1+n] such that n is the maximum of the number of elements in any integer interval [p(i)..i+(1+n)*[i<p(i)]]. 3

%I #13 Oct 28 2021 09:27:19

%S 0,1,1,7,31,185,1275,10095,90109,895169,9793829,116998199,1515196619,

%T 21143666585,316260079951,5047672782687,85623656678457,

%U 1538245254809537,29176112648650441,582614412521648359,12217688610474042487,268445509189890555577

%N Number of permutations p of [1+n] such that n is the maximum of the number of elements in any integer interval [p(i)..i+(1+n)*[i<p(i)]].

%H Alois P. Heinz, <a href="/A324621/b324621.txt">Table of n, a(n) for n = 0..449</a>

%F a(n) = A000166(n+1) - A000179(n+1) for n < 0, a(0) = 0.

%p a:= proc(n) option remember; `if`(n<5, [0, 1$2, 7, 31][n+1],

%p ((2*n^4-3*n^3-2*n^2+n+4)*a(n-1) -(n^5-4*n^4+7*n^2+6*n-14)*

%p a(n-2) -(n^5-2*n^4-4*n^3+2*n^2+13*n-12)*a(n-3)-(n-2)*

%p (n^3+2*n^2+n-2)*a(n-4))/(n^3-n^2-2))

%p end:

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

%t menage[n_] := If[n == 0, 1, 2n Sum[(-1)^k Binomial[2n-k, k] (n-k)!/(2n-k), {k, 0, n}]];

%t a[n_] := If[n == 0, 0, Subfactorial[n+1] - menage[n+1]];

%t a /@ Range[0, 21] (* _Jean-François Alcover_, Oct 28 2021 *)

%Y Row n=1 of A324563 and column of A324564 (as array).

%Y Cf. A000166, A000179.

%K nonn

%O 0,4

%A _Alois P. Heinz_, Mar 09 2019

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 April 25 12:53 EDT 2024. Contains 371969 sequences. (Running on oeis4.)