Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #18 Nov 03 2022 18:33:36
%S 2,3,3,4,4,4,5,5,4,5,5,6,6,5,6,7,6,6,6,5,7,8,7,6,9,8,6,7,7,7,10,6,8,7,
%T 9,8,7,8,7,10,11,7,12,8,6,9,8,9,11,8,7,13,8,10,9,9,7,8,14,8,10,15,12,
%U 8,8,10,11,13,16,11,7,9,9,8,10,9,9,17,8,9,14,8,11,12,12,10,18,11,8,10,19,15
%N If n-th composite is the product of k1-th prime, k2-th prime, ..., kr-th prime then set a(n) = k1 + k2 + ... + kr.
%H Harvey P. Dale, <a href="/A163515/b163515.txt">Table of n, a(n) for n = 1..1000</a>
%e The 1st composite is 4 = 2*2 = prime(1)*prime(1), so a(1) = 1 + 1 = 2;
%e the 2nd composite is 6 = 2*3 = prime(1)*prime(2), so a(2) = 1 + 2 = 3;
%e the 3rd composite is 8 = 2*2*2 = prime(1)*prime(1)*prime(1), so a(3) = 1 + 1 + 1 = 3;
%e the 4th composite is 9 = 3*3 = prime(2)*prime(2), so a(4) = 2 + 2 = 4.
%p A002808 := proc(n) local a; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a) ; end if; end do; end if; end proc: A163515 := proc(n) local c; c := A002808(n) ; pfs := ifactors(c)[2] ; add( op(2,p)*numtheory[pi](op(1,p)), p=pfs) ; end: seq(A163515(n),n=1..100) ; # _R. J. Mathar_, Aug 05 2009
%t kp[c_]:=Total[Times@@@({PrimePi[#[[1]]],#[[2]]}&/@FactorInteger[c])]; kp/@Select[ Range[200],CompositeQ] (* _Harvey P. Dale_, Nov 03 2022 *)
%Y Cf. A000040, A002808, A061395.
%K nonn
%O 1,1
%A _Juri-Stepan Gerasimov_, Jul 30 2009
%E Corrected by _R. J. Mathar_, Aug 05 2009
%E Example edited by _Harvey P. Dale_, Nov 27 2013
%E Further edits by _Jon E. Schoenfield_, Mar 07 2019