OFFSET
2,1
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.
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 0-prepended prime indices of 1617 are {0,2,4,4,5}, with sorted differences {0,1,2,2}, with median 3/2, so a(1617) = 3.
MATHEMATICA
prix[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
Table[2*Median[Differences[Prepend[prix[n], 0]]], {n, 2, 100}]
CROSSREFS
The version for divisors is A063655.
Differences of 0-prepended prime indices are listed by A287352.
The version for prime indices is A360005.
The version for distinct prime indices is A360457.
The version for distinct prime factors is A360458.
The version for prime factors is A360459.
The version for prime multiplicities is A360460.
Positions of even terms are A360556
Positions of odd terms are A360557
KEYWORD
nonn
AUTHOR
Gus Wiseman, Feb 14 2023
STATUS
approved