OFFSET
1,3
COMMENTS
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.
The sequence of runs of a sequence consists of its maximal consecutive constant subsequences when read left-to-right. For example, the runs of (2,2,1,1,1,3,2,2) are (2,2), (1,1,1), (3), (2,2), with sums (4,3,3,4).
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
LINKS
Mathematics Stack Exchange, What is a sequence run? (answered 2011-12-01)
EXAMPLE
The prime indices of 24 are (1,1,1,2), with run-sums (3,2), and this is the 18th composition in standard order, so a(24) = 18.
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
Table[stcinv[Total/@Split[primeMS[n]]], {n, 100}]
CROSSREFS
The version for prime indices instead of standard compositions is A353832.
The version for standard compositions instead of prime indices is A353847.
A ranking of the rows of A354584.
A011782 counts compositions.
A066099 lists standard compositions.
A351014 counts distinct runs in standard compositions.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 17 2022
STATUS
approved