login
A086684
a(n) = n! - Sum_{i} p_i!^e_i, where n = Product_{i} (p_i^e_i).
0
1, 0, 0, 20, 0, 712, 0, 40312, 362844, 3628678, 0, 479001590, 0, 87178286158, 1307674367874, 20922789887984, 0, 6402373705727962, 0, 2432902008176639876, 51090942171709434954, 1124000727777567763198, 0, 620448401733239439359986
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
Sequence in context: A343329 A008426 A055637 * A221335 A298672 A198800
KEYWORD
nonn
AUTHOR
Jon Perry, Jul 28 2003
EXTENSIONS
Edited and extended by Robert G. Wilson v, Aug 16 2003
STATUS
approved