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 A068318 #46 May 15 2025 00:44:37 %S A068318 4,5,6,7,9,8,10,13,10,15,14,19,12,21,16,25,14,20,16,22,31,33,18,26,39, %T A068318 18,43,22,45,32,20,34,49,24,55,40,28,61,24,22,63,44,46,26,69,50,73,24, %U A068318 34,75,36,81,56,30,85,26,62,91,64,42,28,99,70,103,36,46,105,30,74,109 %N A068318 Sum of prime factors of n-th semiprime. %C A068318 Odd k is a term if and only if k - 2 is prime. Goldbach's conjecture implies that every even number k >= 4 is a term. - _Jianing Song_, May 26 2021 %H A068318 T. D. Noe, <a href="/A068318/b068318.txt">Table of n, a(n) for n=1..1000</a> %H A068318 Robert G. Wilson v, <a href="/A068318/a068318.pdf">Graph of n and a(n)</a>. %F A068318 a(n) = A001414(A001358(n)). %F A068318 a(n) = A003415(A001358(n)), the arithmetic derivative. %F A068318 If A001358(n) = s*p, then in this sequence a(n) = s+p. %F A068318 a(n) = A084126(n)+A084127(n). - _Reinhard Zumkeller_, Jul 24 2006 [Typo in formula fixed by _Zak Seidov_, Aug 23 2014] %e A068318 a(2) = 5 because A001358(2) = 6 = 2*3 and 2+3 = 5. %p A068318 with(numtheory): a:=proc(n) if bigomega(n)=2 and nops(factorset(n))=2 then factorset(n)[1]+factorset(n)[2] elif bigomega(n)=2 then 2*sqrt(n) else fi end: seq(a(n),n=1..214); # _Emeric Deutsch_ %t A068318 f[n_] := Total[#1*#2 & @@@ FactorInteger@ n]; f@# & /@ Select[Range@300, PrimeOmega@# == 2 &] (* _Robert G. Wilson v_, Jan 23 2013 *) %o A068318 (Python) %o A068318 from math import isqrt %o A068318 from sympy import primepi, primerange, factorint %o A068318 def A068318(n): %o A068318 def bisection(f,kmin=0,kmax=1): %o A068318 while f(kmax) > kmax: kmax <<= 1 %o A068318 kmin = kmax >> 1 %o A068318 while kmax-kmin > 1: %o A068318 kmid = kmax+kmin>>1 %o A068318 if f(kmid) <= kmid: %o A068318 kmax = kmid %o A068318 else: %o A068318 kmin = kmid %o A068318 return kmax %o A068318 def f(x): return int(n+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//p) for p in primerange(s+1))) %o A068318 return sum(p*e for p,e in factorint(bisection(f,n,n)).items()) # _Chai Wah Wu_, Apr 03 2025 %o A068318 (PARI) s(n) = my(f = factor(n)); if(bigomega(f) == 2, f[,1]~*f[,2], 0); %o A068318 list(lim) = select(x -> x > 0, apply(s, vector(lim, i, i))); \\ _Amiram Eldar_, May 15 2025 %Y A068318 Semiprimes are in A001358. %Y A068318 Cf. A084126, A084127, A120831, A120832, A120833, A120834, A109313. %K A068318 nonn %O A068318 1,1 %A A068318 _Reinhard Zumkeller_, Feb 27 2002