OFFSET
0,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..800
FORMULA
MAPLE
A003415 := proc(n) local pfs ; if n <= 1 then 0 ; else pfs := ifactors(n)[2] ; n*add(op(2, p)/op(1, p), p=pfs) ; fi; end proc:
seq(A168386(n), n=0..80) ; # R. J. Mathar, Nov 26 2009
# second Maple program:
d:= n-> n*add(i[2]/i[1], i=ifactors(n)[2]):
a:= proc(n) option remember;
`if`(n<2, 0, a(n-2)*n+doublefactorial(n-2)*d(n))
end:
seq(a(n), n=0..40); # Alois P. Heinz, Jun 06 2015
MATHEMATICA
d[n_] := n*Total[#2/#1& @@@ FactorInteger[n]];
a[0] = a[1] = 0; a[n_] := d[n!!];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, May 18 2018 *)
PROG
(Python 3.8+)
from collections import Counter
from sympy import factorial2, factorint
def A168386(n): return sum((factorial2(n)*e//p for p, e in sum((Counter(factorint(m)) for m in range(n, 1, -2)), start=Counter({2:0})).items())) if n > 1 else 0 # Chai Wah Wu, Jun 12 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Nov 24 2009
EXTENSIONS
Program replaced by a structured program - R. J. Mathar, Nov 26 2009
STATUS
approved