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
0, 1, 1, 7, 31, 185, 1275, 10095, 90109, 895169, 9793829, 116998199, 1515196619, 21143666585, 316260079951, 5047672782687, 85623656678457, 1538245254809537, 29176112648650441, 582614412521648359, 12217688610474042487, 268445509189890555577 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..449

FORMULA

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

MAPLE

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

      ((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)*

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

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

    end:

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

MATHEMATICA

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

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

a /@ Range[0, 21] (* Jean-François Alcover, Oct 28 2021 *)

CROSSREFS

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

Cf. A000166, A000179.

Sequence in context: A322205 A139151 A139060 * A223144 A155521 A201116

Adjacent sequences:  A324618 A324619 A324620 * A324622 A324623 A324624

KEYWORD

nonn

AUTHOR

Alois P. Heinz, Mar 09 2019

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 May 28 18:24 EDT 2022. Contains 354122 sequences. (Running on oeis4.)