OFFSET
2,2
COMMENTS
In the following guide to related sequences,
c(n) = Sum_{0<j<n} s(n)-s(j),
t(n) = Sum_{0<j<k<=n} s(k)-s(j).
s(k).................c(n)........t(n)
LINKS
Danny Rorabaugh, Table of n, a(n) for n = 2..400
FORMULA
a(n) = a(n-1)+(n-1)s(n)-p(n-1), where s(n) = n! and p(k) = 1!+2!+...+k!.
a(n) = Sum_{k=2..n} A206816(k).
EXAMPLE
a(3) = (2-1) + (6-1) + (6-2) = 10.
MATHEMATICA
PROG
(Sage) [sum([sum([factorial(k)-factorial(j) for j in range(1, k)]) for k in range(2, n+1)]) for n in range(2, 21)] # Danny Rorabaugh, Apr 18 2015
(PARI) a(n)=sum(j=1, n, j!*(2*j-n-1)) \\ Charles R Greathouse IV, Oct 11 2015
(PARI) a(n)=my(t=1); sum(j=1, n, t*=j; t*(2*j-n-1)) \\ Charles R Greathouse IV, Oct 11 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Feb 12 2012
STATUS
approved