A353861 Number of distinct weak run-sums of the prime indices of n.
1, 2, 2, 3, 2, 3, 2, 4, 3, 3, 2, 3, 2, 3, 3, 5, 2, 4, 2, 4, 3, 3, 2, 4, 3, 3, 4, 4, 2, 4, 2, 6, 3, 3, 3, 4, 2, 3, 3, 4, 2, 4, 2, 4, 4, 3, 2, 5, 3, 4, 3, 4, 2, 5, 3, 5, 3, 3, 2, 4, 2, 3, 3, 7, 3, 4, 2, 4, 3, 4, 2, 5, 2, 3, 4, 4, 3, 4, 2, 5, 5, 3, 2, 4, 3, 3, 3, 5, 2, 5, 3, 4, 3, 3, 3, 6, 2, 4, 4, 5, 2, 4, 2, 5, 4, 3, 2, 5
Offset: 1
Keywords
Examples
The prime indices of 72 are {1,1,1,2,2}, with weak runs {}, {1}, {1,1}, {1,1,1}, {2}, {2,2}, which have sums 0, 1, 2, 3, 2, 4, of which 5 are distinct, so a(72) = 5.
Links
Crossrefs
Programs
-
Mathematica
Table[Length[Union@@Cases[FactorInteger[n],{p_,k_}:>Range[0,k]*PrimePi[p]]],{n,100}]
-
PARI
pis_to_runs(n) = { my(runs=List([]), f=factor(n)); for(i=1,#f~,while(f[i,2], listput(runs,primepi(f[i,1])); f[i,2]--)); (runs); }; A353861(n) = if(1==n,n,my(pruns = pis_to_runs(n), runsum = 0, runsums = List([])); for(i=1,#pruns, listput(runsums, runsum); if((i>1) && pruns[i] == pruns[i-1], runsum += pruns[i], runsum = pruns[i])); listput(runsums, runsum); #Set(runsums)); \\ Antti Karttunen, Jan 20 2025
Extensions
Data section extended to a(108) by Antti Karttunen, Jan 20 2025
Comments