OFFSET
1,1
EXAMPLE
a(1) = semiprime(3almostprime(1)) - 3almostprime(semiprime(1)) = 22 - 20 = 2.
a(2) = semiprime(3almostprime(2)) - 3almostprime(semiprime(2)) = 34 - 28 = 6.
a(3) = semiprime(3almostprime(3)) - 3almostprime(semiprime(3)) = 51 - 44 = 7.
a(4) = semiprime(3almostprime(4)) - 3almostprime(semiprime(4)) = 57 - 45 = 12.
a(7) = semiprime(3almostprime(7)) - 3almostprime(semiprime(7)) = 87 - 98 = -11, which is the first negative value in the commutators we have seen in these related set of sequences, exposing an incorrect assumption.
MATHEMATICA
p[k_] := p[k] = Select[Range[1000], PrimeOmega[#] == k &]; p[2][[ Take[p[3], 70]]] - p[3][[Take[p[2], 70]]] (* Giovanni Resta, Jun 13 2016 *)
PROG
(Python)
from math import isqrt
from sympy import primepi, primerange, integer_nthroot
def A124319(n):
def f(x): return int(x-sum(primepi(x//(k*m))-b for a, k in enumerate(primerange(integer_nthroot(x, 3)[0]+1)) for b, m in enumerate(primerange(k, isqrt(x//k)+1), a)))
def g(x): return int(x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))
def A001358(n):
m, k = n, g(n)+n
while m != k:
m, k = k, g(k)+n
return m
m, k = n, f(n)+n
while m != k:
m, k = k, f(k)+n
r, k = (p:=A001358(n)), f(p)+p
while r != k:
r, k = k, f(k)+p
return A001358(m)-r # Chai Wah Wu, Aug 17 2024
CROSSREFS
Cf. A124317 Semiprimes indexed by 3-almost primes. A124318 3-almost primes indexed by semiprimes. A124319 semiprime(3almostprime(n)) - 3almostprime(semiprime(n)). A124308 Primes indexed by 5-almost primes. A124309 5-almost primes indexed by primes. A124310 prime(5almostprime(n)) - 5almostprime(prime(n)). 4-almost primes indexed by primes = A124283. prime(4almostprime(n)) - 4almostprime(prime(n)) = A124284. Primes indexed by 3-almost primes = A124268. 3-almost primes indexed by primes = A124269. prime(3almostprime(n)) - 3almostprime(prime(n)) = A124270. See also A106349 Primes indexed by semiprimes. See also A106350 Semiprimes indexed by primes. See also A122824 Prime(semiprime(n)) - semiprime(prime(n)). Commutator [A000040, A001358] at n.
KEYWORD
easy,sign,less
AUTHOR
Jonathan Vos Post, Oct 26 2006
EXTENSIONS
a(18) corrected and a(22)-a(65) from Giovanni Resta, Jun 13 2016
STATUS
approved