OFFSET
1,4
LINKS
FORMULA
a(1) = 0, and for n > 1, if A067029(n)=1 [when n is one of the terms of A247180], a(n) = a(A028234(n)), otherwise a(n) = A067029(n)+a(A028234(n)).
From Amiram Eldar, Sep 28 2023: (Start)
Additive with a(p) = 0, and a(p^e) = e for e >= 2.
a(n) >= 0, with equality if and only if n is squarefree (A005117).
MATHEMATICA
Table[Total@ Map[Last, Select[FactorInteger@ n, Last@ # > 1 &] /. {} -> {{0, 0}}], {n, 120}] (* Michael De Vlieger, Aug 11 2016 *)
PROG
(Scheme, two variants, the first one with memoizing definec-macro)
(Perl) sub a275812 { vecsum( grep {$_> 1} map {$_->[1]} factor_exp(shift) ); } # Dana Jacobsen, Aug 15 2016
(Python)
from sympy import factorint, primefactors
def a001222(n):
return 0 if n==1 else a001222(n//primefactors(n)[0]) + 1
def a056169(n):
f=factorint(n)
return 0 if n==1 else sum(1 for i in f if f[i]==1)
def a(n):
return a001222(n) - a056169(n)
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 19 2017
(PARI) a(n) = my(f = factor(n)); sum(k=1, #f~, if (f[k, 2] > 1, f[k, 2])); \\ Michel Marcus, Jul 19 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Antti Karttunen, Aug 11 2016
STATUS
approved