login
A105926
First differences of A000166.
2
-1, 1, 1, 7, 35, 221, 1589, 12979, 118663, 1201465, 13349609, 161530271, 2114578091, 29780308117, 448995414685, 7215997736011, 123153028027919, 2224451568754289, 42395429898611153, 850263899633257015, 17900292623858042419, 394701452356069835341
OFFSET
0,4
LINKS
FORMULA
a(n) = n*!n - (-1)^n, where !n = A000166(n) is subfactorial. - Vladimir Reshetnikov, Nov 03 2015
(2n + 1) a(n+2) = (2n^2 + 5n + 4) a(n+1) + (2n^2 + 5n + 3) a(n). E.g.f.: exp(-x)*(2*x-1)/(x-1)^2. - Robert Israel, Nov 03 2015
MAPLE
a:=n->sum((-1)^k * (n-k-1) * n!/k!, k=0..n): seq(a(n), n=0..20); # Zerinvary Lajos, Jun 27 2007
A000166:= gfun:-rectoproc({a(0)=1, a(1)=0, a(n) = (n-1)*(a(n-1)+a(n-2))}, a(n), remember):
seq(A000166(n+1)-A000166(n), n=0..100); # Robert Israel, Nov 03 2015
MATHEMATICA
Table[Subfactorial[n] - Subfactorial[n - 1], {n, 1, 22}] (* Zerinvary Lajos, Jul 09 2009 *)
Table[n Subfactorial[n] - (-1)^n, {n, 0, 20}] (* Vladimir Reshetnikov, Nov 01 2015 *)
Differences[Table[(-1)^n HypergeometricPFQ[{-n, 1}, {}, 1], {n, 0, 20}]] (* Peter Luschny, Nov 03 2015 *)
CROSSREFS
Cf. A000166.
Sequence in context: A263513 A274073 A177261 * A184460 A096686 A165505
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Apr 27 2005
STATUS
approved