A373956 Greatest sum of run-compression of a permutation of the prime indices of n.
0, 1, 2, 1, 3, 3, 4, 1, 2, 4, 5, 4, 6, 5, 5, 1, 7, 5, 8, 5, 6, 6, 9, 4, 3, 7, 2, 6, 10, 6, 11, 1, 7, 8, 7, 6, 12, 9, 8, 5, 13, 7, 14, 7, 7, 10, 15, 4, 4, 7, 9, 8, 16, 5, 8, 6, 10, 11, 17, 7, 18, 12, 8, 1, 9, 8, 19, 9, 11, 8, 20, 7, 21, 13, 8, 10, 9, 9, 22, 5
Offset: 1
Keywords
Examples
The prime indices of 24 are {1,1,1,2}, with permutations such as (1,1,2,1) whose run-compression sums to 4, so a(24) = 4. The prime indices of 216 are {1,1,1,2,2,2}, with permutations such as (1,2,1,2,1,2) whose run-compression sums to 9, so a(216) = 9.
Crossrefs
Positions of first appearances are 1 followed by the primes A000040.
Positions of 1 are A000079 (powers of two) except 1.
Positions of 2 are A000244 (powers of three) except 1.
Positions of 3 are {6} U A000351 (six or powers of five) except 1.
For number of runs instead of sum of run-compression we have A373957.
For prime factors instead of indices we have A374250.
A003242 counts run-compressed compositions, i.e., anti-runs.
A007947 (squarefree kernel) represents run-compression of multisets.
A008480 counts permutations of prime factors (or prime indices).
A116861 counts partitions by sum of run-compression.
Programs
-
Mathematica
prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]; Table[Max@@(Total[First/@Split[#]]&/@Permutations[prix[n]]),{n,100}]
Comments