login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A334716 a(n) = !n + n * n!, where !n = A000166(n) is subfactorial of n. 2
1, 1, 5, 20, 105, 644, 4585, 37134, 337393, 3399416, 37622961, 453769370, 5924234041, 83242063332, 1252567177849, 20096182035734, 342461702459745, 6177536369911664, 117598028364137953, 2356007639327453106, 49553054794725702121, 1091705092860949184540 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

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

Wikipedia, Derangement

FORMULA

E.g.f.: x/(x-1)^2 - exp(-x)/(x-1).

a(n) = A000166(n) + A001563(n) = !n + n * n!.

MAPLE

a:= proc(n) option remember; `if`(n<3, [1, 1, 5][n+1],

      ((2*n+1)*(n-1)*a(n-1)-(n-1)*(n^2-2*n-2)*a(n-2)

       -(n+1)*(n-1)*(n-2)*a(n-3))/n)

    end:

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

MATHEMATICA

a[n_] := Subfactorial[n] + n n!;

a /@ Range[0, 23] (* Jean-Fran├žois Alcover, Apr 26 2021 *)

CROSSREFS

Main diagonal of A334715.

Cf. A000142, A000166, A001563.

Sequence in context: A259275 A109500 A137961 * A167145 A277032 A300490

Adjacent sequences:  A334713 A334714 A334715 * A334717 A334718 A334719

KEYWORD

nonn

AUTHOR

Alois P. Heinz, May 08 2020

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 17 16:06 EDT 2021. Contains 348065 sequences. (Running on oeis4.)