Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #13 Aug 31 2021 13:35:28
%S 0,1,2,3,3,5,5,7,8,10,11,11,9,15,15,11,18,17,20,22,19,15,23,26,17,23,
%T 29,30,29,34,21,37,35,38,31,35,43,39,43,35,27,48,29,50,52,47,50,47,43,
%U 56,60,35,62,53,59,60,67,69,39,70,63,41,55,71,77,71,65,59,45,71,83,82,82
%N a(n) = difference between the n-th composite number and the sum of its prime factors with repetition.
%H Harvey P. Dale, <a href="/A145834/b145834.txt">Table of n, a(n) for n = 1..2500</a>
%F a(n) = A075255(A002808(n)) = A002808(n) - A001414(A002808(n)).
%e a(1) = 4 - (2+2) = 0; a(2) = 6 - (2+3) = 1; a(3) = 8 - (2+2+2) = 2 ; a(4) = 9 - (3+3) = 3; a(5) = 10 - (2+5) = 3.
%t cnpf[n_]:=n-Total[Flatten[Table[#[[1]],#[[2]]]&/@FactorInteger[n]]]; cnpf/@ Select[Range[100],CompositeQ] (* _Harvey P. Dale_, Aug 31 2021 *)
%o (PARI) A145834(n)={for(k=0,primepi(n),isprime(n++)&k--);n+0-sum(i=1,#n=factor(n)~,n[1,i]*n[2,i])} \\ _M. F. Hasler_, Oct 31 2008
%Y Cf. A001414, A002808, A075255.
%K nonn
%O 1,3
%A _Alexander R. Povolotsky_, Oct 20 2008
%E Edited and extended by _Ray Chandler_, Oct 24 2008