OFFSET
1,1
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.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. Of course, the alternating sum of prime indices is also the reverse-alternating sum of reversed prime indices.
EXAMPLE
The initial terms and their prime indices:
10: {1,3}
21: {2,4}
40: {1,1,1,3}
55: {3,5}
84: {1,1,2,4}
90: {1,2,2,3}
91: {4,6}
160: {1,1,1,1,1,3}
187: {5,7}
189: {2,2,2,4}
210: {1,2,3,4}
220: {1,1,3,5}
247: {6,8}
250: {1,3,3,3}
336: {1,1,1,1,2,4}
360: {1,1,1,2,2,3}
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
ats[y_]:=Sum[(-1)^(i-1)*y[[i]], {i, Length[y]}];
Select[Range[0, 100], ats[primeMS[#]]==-2&]
CROSSREFS
Below we use k to indicate alternating sum.
The k > 0 version is A026424.
These are the positions of -2's in A316524.
The k = -1 version is A345959.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A344606 counts alternating permutations of prime indices.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jul 12 2021
STATUS
approved