login
A118138
Sum of factorials of prime factors, with multiplicity.
1
2, 6, 4, 120, 8, 5040, 6, 12, 122, 39916800, 10, 6227020800, 5042, 126, 8, 355687428096000, 14, 121645100408832000, 124, 5046, 39916802, 25852016738884976640000, 12, 240, 6227020802, 18, 5044
OFFSET
2,1
COMMENTS
For primes p, a(p) = p!. For powers of primes a(p^k) = k*(p!). For nonsquare semiprimes A006881 = pq, we have a(pq)= p! + q!. For sphenic numbers A007304 = p * q * r we have a(pqr) = p! + q! + r!. See also A008472 the sum of the distinct primes dividing n.
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