login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A132371
a(n) = n! - Sum_{j=1..n-1} j!.
3
1, 1, 3, 15, 87, 567, 4167, 34407, 316647, 3219687, 35878887, 435046887, 5704064487, 80428314087, 1213746099687, 19521187251687, 333363035571687, 6024361885107687, 114864714882483687, 2304476522241459687, 48529614677597619687, 1070348458111786419687
OFFSET
1,3
LINKS
FORMULA
From G. C. Greubel, May 02 2021: (Start)
a(n) = A000142(n) - A007489(n-1).
a(n) = n! - A003422(n) + 1. (End)
MAPLE
seq(factorial(n)-(sum(factorial(j), j=1..n-1)), n=1..22); # Emeric Deutsch, May 26 2008
MATHEMATICA
With[{fctrls=Range[30]!}, Table[fctrls[[n]]-Total[Take[fctrls, n-1]], {n, 30}]] (* Harvey P. Dale, Feb 27 2012 *)
Table[n! -Sum[j!, {j, n-1}], {n, 30}] (* G. C. Greubel, May 02 2021 *)
PROG
(Magma) A132371:= func< n | n eq 1 select 1 else Factorial(n) - (&+[Factorial(j): j in [1..n-1]]) >;
[A132371(n): n in [1..30]]; // G. C. Greubel, May 02 2021
(Sage) [factorial(n) - sum(factorial(j) for j in (1..n-1)) for n in (1..30)] # G. C. Greubel, May 02 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ben Branman, Nov 09 2007
EXTENSIONS
Corrected and extended by N. J. A. Sloane, Nov 11 2007
Better definition from Emeric Deutsch, May 26 2008
STATUS
approved