OFFSET
2,1
COMMENTS
LINKS
Eric Weisstein's World of Mathematics, Factorial Sums.
FORMULA
a(n) = SUM[p|n] p!. a(n) = SUM[i=1..k] e_i * (p_i)! where n = (p_1^e_1)*(p_2^e_2)*...*(p_k^e_k).
EXAMPLE
a(6) = 8 because 6 = 2 * 3 and 2! + 3! = 8.
a(12) = 10 because 12 = 2^2 * 3 and 2! + 2! + 3! = 10.
a(30) = 128 because 30 = 2 * 3 * 5 and 2! + 3! + 5! = 128.
MATHEMATICA
Table[Total[Flatten[PadRight[{}, Last[#], First[#]]&/@FactorInteger[ n]]!], {n, 30}] (* Harvey P. Dale, Jan 06 2012 *)
PROG
(PARI) a(n)=my(f=factor(n)); sum(i=1, #f~, f[i, 1]!*f[i, 2]) \\ Charles R Greathouse IV, Sep 14 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, May 13 2006
STATUS
approved