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 + ....
The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
EXAMPLE
The partition with Heinz number 525 is (4,3,3,2) so a(525) = 4 - 3 - 3 + 2 = 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[Reverse[primeMS[n]]], {n, 30}]
CROSSREFS
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 09 2022
STATUS
approved