|
|
A316523
|
|
Number of odd multiplicities minus number of even multiplicities in the canonical prime factorization of n.
|
|
27
|
|
|
0, 1, 1, -1, 1, 2, 1, 1, -1, 2, 1, 0, 1, 2, 2, -1, 1, 0, 1, 0, 2, 2, 1, 2, -1, 2, 1, 0, 1, 3, 1, 1, 2, 2, 2, -2, 1, 2, 2, 2, 1, 3, 1, 0, 0, 2, 1, 0, -1, 0, 2, 0, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 0, -1, 2, 3, 1, 0, 2, 3, 1, 0, 1, 2, 0, 0, 2, 3, 1, 0, -1, 2, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,6
|
|
LINKS
|
|
|
FORMULA
|
If i and j are coprime, a(i*j) = a(i)+a(j). - Robert Israel, Aug 27 2018
Additive with a(p^e) = (-1)^(e+1).
Sum_{k=1..n} a(k) = n * log(log(n)) + c * n + O(n/log(n)), where c = A077761 - 2*A179119 = -0.398962... . (End)
|
|
MAPLE
|
f:= proc(n) local F;
F:= map(t -> t[2], ifactors(n)[2]);
2*nops(select(type, F, odd))-nops(F);
end proc:
|
|
MATHEMATICA
|
Table[Total[-(-1)^If[n==1, {}, FactorInteger[n][[All, 2]]]], {n, 100}]
|
|
PROG
|
(PARI) a(n) = my(f=factor(n)); -sum(k=1, #f~, (-1)^(f[k, 2])); \\ Michel Marcus, Jul 08 2018; corrected Jun 13 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|