OFFSET
1,3
COMMENTS
We define the self-signed alternating sum of a multiset y to be Sum_{k in y} k*(-1)^k.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
MATHEMATICA
prix[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
asum[y_]:=Sum[x*(-1)^x, {x, y}];
Table[asum[prix[n]], {n, 100}]
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 23 2023
STATUS
approved