OFFSET
1,3
COMMENTS
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.
We define the reverse-weighted alternating sum of a sequence (y_1,...,y_k) to be Sum_{i=1..k} (-1)^(k-i) i * y_{k-i+1}.
EXAMPLE
The prime indices of 300 are {1,1,2,3,3}, with reverse-weighted alternating sum 1*3 - 2*3 + 3*2 - 4*1 + 5*1 = 4, so a(300) = 4.
MATHEMATICA
prix[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
revaltwtsum[y_]:=Sum[(-1)^(Length[y]-k)*k*y[[-k]], {k, 1, Length[y]}];
Table[revaltwtsum[prix[n]], {n, 100}]
CROSSREFS
KEYWORD
sign
AUTHOR
Gus Wiseman, Jun 13 2023
STATUS
approved