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