login
A366749
Self-signed alternating sum of the prime indices of n.
3
0, -1, 2, -2, -3, 1, 4, -3, 4, -4, -5, 0, 6, 3, -1, -4, -7, 3, 8, -5, 6, -6, -9, -1, -6, 5, 6, 2, 10, -2, -11, -5, -3, -8, 1, 2, 12, 7, 8, -6, -13, 5, 14, -7, 1, -10, -15, -2, 8, -7, -5, 4, 16, 5, -8, 1, 10, 9, -17, -3, 18, -12, 8, -6, 3, -4, -19, -9, -7, 0
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.
FORMULA
a(n) = Sum_{k in A112798(n)} k*(-1)^k.
a(n) = A366531(n) - A366528(n).
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}]
CROSSREFS
With summands of 2^(n-1) we get A048675.
With summands of (-1)^k we get A195017.
The version for alternating prime indices is A346697 - A346698 = A316524.
Positions of zeros are A366748, counted by A239261.
A112798 lists prime indices, length A001222, sum A056239, reverse A296150.
A300061 lists numbers with even sum of prime indices, odd A300063.
A366528 adds up odd prime indices, counted by A113685.
A366531 adds up even prime indices, counted by A113686.
Sequence in context: A374706 A354871 A303777 * A304529 A071281 A361249
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 23 2023
STATUS
approved