OFFSET
1,2
COMMENTS
a(1) = 1, a(2) = 2, define S(k) = sum of all the terms other than a(k) k < n. a(n) = Sum_{k=1..n-1} S(k).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
Luis Manuel Rivera, Integer sequences and k-commuting permutations, arXiv preprint arXiv:1406.3081, 2014
FORMULA
a(n) = (n-2)*Sum_{j=1..n-1} a(j).
E.g.f.: 3*(x-2)*log(1-x) - 5*x + x^2. - Vladeta Jovovic, May 06 2003
From Reinhard Zumkeller, Apr 14 2007: (Start)
Sum_{k=1..n} a(k) = A052560(n-1) for n > 1.
a(n) = A052673(n-2) for n > 2. (End)
EXAMPLE
a(4) = {a(1) + a(2)} + {a(1) +a(3)} + {a(2) + a(3)} = 12.
MAPLE
a := proc(n) option remember: if n=1 then RETURN(1) fi: if n=2 then RETURN(2) fi: 3*(n-2)*(n-2)! end: for n from 1 to 40 do printf(`%d, `, a(n)) od: # James A. Sellers, May 19 2003
MATHEMATICA
Join[{1, 2}, Table[3n n!, {n, 20}]] (* Harvey P. Dale, Feb 27 2012 *)
PROG
(Magma) [n le 2 select n else 3*(n-2)*Factorial(n-2): n in [1..40]]; // G. C. Greubel, Feb 03 2024
(SageMath) [1, 2]+[3*(n-2)*factorial(n-2) for n in range(3, 41)] // G. C. Greubel, Feb 03 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 06 2003
EXTENSIONS
Simpler description from Vladeta Jovovic, May 06 2003
More terms from James A. Sellers, May 19 2003
STATUS
approved