A005008 a(n) = n! - n^2.
1, 0, -2, -3, 8, 95, 684, 4991, 40256, 362799, 3628700, 39916679, 479001456, 6227020631, 87178291004, 1307674367775, 20922789887744, 355687428095711, 6402373705727676, 121645100408831639, 2432902008176639600, 51090942171709439559, 1124000727777607679516
Offset: 0
Links
Programs
-
Magma
[Factorial(n) - n^2: n in [0..25]]; // Vincenzo Librandi, Jun 28 2011
-
Mathematica
Table[n! - n^2, {n, 0, 30}] (* Vladimir Joseph Stephan Orlovsky, Jun 27 2011 *)
-
PARI
a(n)=n!-n^2 \\ Charles R Greathouse IV, Jun 28 2011
Formula
E.g.f.: 1/(1 - x) - x*(1 + x)*exp(x). - Ilya Gutkovskiy, Jan 27 2017