login
A176504
a(n) = m + k where prime(m)*prime(k) = semiprime(n).
30
2, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 7, 9, 8, 10, 8, 9, 8, 10, 11, 12, 9, 11, 13, 9, 14, 10, 15, 12, 10, 13, 16, 11, 17, 14, 12, 18, 11, 10, 19, 15, 16, 12, 20, 17, 21, 11, 13, 22, 14, 23, 18, 13, 24, 12, 19, 25, 20, 15, 12, 26, 21, 27, 14, 16, 28, 13, 22, 29, 17, 15, 30, 23, 13, 31
OFFSET
1,1
FORMULA
a(n) = A056239(A001358(n)) = A338912(n) + A338913(n). - Gus Wiseman, Dec 04 2020
sqrt(n/(log n log log n)) << a(n) << n/log log n. - Charles R Greathouse IV, Apr 17 2024
EXAMPLE
From Gus Wiseman, Dec 04 2020: (Start)
A semiprime (A001358) is a product of any two prime numbers. The sequence of all semiprimes together with their prime indices and weights begins:
4: 1 + 1 = 2
6: 1 + 2 = 3
9: 2 + 2 = 4
10: 1 + 3 = 4
14: 1 + 4 = 5
15: 2 + 3 = 5
21: 2 + 4 = 6
22: 1 + 5 = 6
25: 3 + 3 = 6
26: 1 + 6 = 7
(End)
MAPLE
isA001358 := proc(n) numtheory[bigomega](n) = 2 ; end proc:
A001358 := proc(n) option remember ; if n = 1 then return 4 ; else for a from procname(n-1)+1 do if isA001358(a) then return a; end if; end do; end if; end proc:
A084126 := proc(n) min(op(numtheory[factorset](A001358(n)))) ; end proc:
A084127 := proc(n) max(op(numtheory[factorset](A001358(n)))) ; end proc:
A176504 := proc(n) numtheory[pi](A084126(n)) + numtheory[pi](A084127(n)) ; end proc: seq(A176504(n), n=1..80) ; # R. J. Mathar, Apr 20 2010
MATHEMATICA
Table[If[SquareFreeQ[n], Total[PrimePi/@First/@FactorInteger[n]], 2*PrimePi[Sqrt[n]]], {n, Select[Range[100], PrimeOmega[#]==2&]}] (* Gus Wiseman, Dec 04 2020 *)
PROG
(Python)
from math import isqrt
from sympy import primepi, primerange, factorint
from oeis_sequences.OEISsequences import bisection
def A176504(n):
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)))
return sum(primepi(p)*e for p, e in factorint(bisection(f, n, n)).items()) # Chai Wah Wu, Jan 02 2026
CROSSREFS
A056239 is the version for not just semiprimes.
A087794 gives the product of the same two indices.
A176506 gives the difference of the same two indices.
A338904 puts the n-th semiprime in row a(n).
A001358 lists semiprimes.
A006881 lists squarefree semiprimes.
A338898/A338912/A338913 give the prime indices of semiprimes.
A338899/A270650/A270652 give the prime indices of squarefree semiprimes, with product/sum/difference A339361/A339362/A338900.
Sequence in context: A027434 A319434 A174697 * A196162 A071940 A085883
KEYWORD
nonn
AUTHOR
EXTENSIONS
Entries checked by R. J. Mathar, Apr 20 2010
STATUS
approved