This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A163831 #14 Feb 21 2022 09:53:54 %S A163831 2,3,5,5,6,8,9,10,12,13,15,15,16,19,19,19,21,22,24,27,26,26,28,30,29, %T A163831 31,34,35,37,38,36,42,41,43,42,44,47,47,49,47,47,53,50,55,58,56,58,59, %U A163831 58,62,65,61,67,66,68,69,73,73,68,76,75,71,75,80,82,81,81,80,78,84,89,89,90,92 %N A163831 a(n) is the n-th composite minus the sum of the indices of the primes in its prime factorization. %C A163831 For the n-th composite c(n) = A002808(n), determine its canonical factorization c(n) = Product_{j} prime(j)^e_j; then A163515(n) = Sum_{j} e_j*j; a(n) = c(n) - A163515(n). %H A163831 Harvey P. Dale, <a href="/A163831/b163831.txt">Table of n, a(n) for n = 1..1000</a> %F A163831 a(n) = A002808(n) - A163515(n). %e A163831 A002808(1) = 4 = prime(1)*prime(1), so a(1) = 4 - (1+1) = 2. %e A163831 A002808(2) = 6 = prime(1)*prime(2), so a(2) = 6 - (1+2) = 3. %e A163831 A002808(3) = 8 = prime(1)*prime(1)*prime(1), so a(3) = 8 - (1+1+1) = 5. %p A163831 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: %p A163831 A163515 := proc(n) local c; c := A002808(n) ; pfs := ifactors(c)[2] ; add( op(2,p)*numtheory[pi](op(1,p)), p=pfs) ; end: %p A163831 A163831 := proc(n) A002808(n)-A163515(n) ; end: seq(A163831(n),n=1..100) ; # _R. J. Mathar_, Aug 05 2009 %t A163831 cmsi[n_]:=n-Total[(PrimePi/@(Flatten[Table[#[[1]],#[[2]]]&/@ FactorInteger[ n]]))]; cmsi/@Select[Range[100],CompositeQ] (* _Harvey P. Dale_, Dec 15 2021 *) %Y A163831 Cf. A002808, A163515, A163829. %K A163831 nonn %O A163831 1,1 %A A163831 _Juri-Stepan Gerasimov_, Aug 05 2009 %E A163831 Edited and corrected by _R. J. Mathar_, Aug 05 2009