A374247 The greatest number of runs possible in a permutation of the prime factors of n (A373957) minus the number of distinct such factors (A001221).
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0
Offset: 1
Keywords
Examples
The runs of the 6 permutations of the prime factors of 36 are: ((2,2),(3,3)) ((2),(3),(2),(3)) ((2),(3,3),(2)) ((3),(2,2),(3)) ((3),(2),(3),(2)) ((3,3),(2,2)) The longest length is 4, so a(36) = 4 - 2 = 2.
Crossrefs
Programs
-
Mathematica
prifacs[n_]:=If[n==1,{},Flatten[ConstantArray@@@FactorInteger[n]]]; Table[Max@@Table[Length[Split[y]], {y,Permutations[prifacs[n]]}]-PrimeNu[n],{n,100}]
Comments