OFFSET
1,2
COMMENTS
The median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length). Since the denominator is always 1 or 2, the median can be represented as an integer by multiplying by 2.
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 (4,2,1) has Heinz number 42 and conjugate (3,2,1,1) with median 3/2, so a(42) = 3.
MATHEMATICA
prix[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
conj[y_]:=If[Length[y]==0, y, Table[Length[Select[y, #>=k&]], {k, 1, Max[y]}]];
Table[If[n==1, 0, 2*Median[conj[prix[n]]]], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 25 2023
STATUS
approved