login
A357630
Skew-alternating sum of the prime indices of n.
21
0, 1, 2, 0, 3, -1, 4, -1, 0, -2, 5, -2, 6, -3, -1, 0, 7, -3, 8, -3, -2, -4, 9, 1, 0, -5, -2, -4, 10, -4, 11, 1, -3, -6, -1, 0, 12, -7, -4, 2, 13, -5, 14, -5, -3, -8, 15, 2, 0, -5, -5, -6, 16, -1, -2, 3, -6, -9, 17, 1, 18, -10, -4, 0, -3, -6, 19, -7, -7, -6, 20
OFFSET
1,3
COMMENTS
We define the skew-alternating sum of a sequence (A, B, C, D, E, F, G, ...) to be A - B - C + D + E - F - G + ....
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.
EXAMPLE
The prime indices of 525 are {2,3,3,4} so a(525) = 2 - 3 - 3 + 4 = 0.
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
skats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[(i+1)/2]), {i, Length[f]}];
Table[skats[primeMS[n]], {n, 30}]
CROSSREFS
The original alternating sum is A316524, reverse A344616.
The reverse version is A357634.
The half-alternating form is A357629, reverse A357633.
Positions of zeros are A357632, reverse A357636.
The version for standard compositions is A357623, reverse A357624.
These partitions are counted by A357638, half A357637.
A056239 adds up prime indices, row sums of A112798.
A351005 = alternately equal and unequal partitions, compositions A357643.
A351006 = alternately unequal and equal partitions, compositions A357644.
A357641 counts comps w/ half-alt sum 0, partitions A357639, even A357642.
Sequence in context: A357634 A344616 A316524 * A194549 A063277 A029178
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 09 2022
STATUS
approved