OFFSET
1,4
COMMENTS
a(p) = 0 iff p is prime.
FORMULA
a(n) = n! - A118138(n). - R. J. Mathar, Sep 15 2012
EXAMPLE
a(6) = 6! - 2! - 3! = 720 - 2 - 6 = 712.
MATHEMATICA
g[n_] := Plus @@ Flatten[Table[ # [[1]]! ^ # [[2]], {1}] & /@ FactorInteger[n]]; Table[n! - f[n], {n, 1, 24}]
PROG
(PARI) for(i=1, 20, f=factor(i); print1(", "i!-sum(j=1, length(f[, 1]), f[j, 1]!^f[j, 2])))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Jul 28 2003
EXTENSIONS
Edited and extended by Robert G. Wilson v, Aug 16 2003
STATUS
approved