login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A124319
Semiprime(3almostprime(n))-3almostprime(semiprime(n)). Commutator[A001358, A014612] at n.
3
2, 6, 7, 12, 16, 17, -11, 24, 23, 20, -1, 10, 48, 40, 39, 26, 14, 4, -1, 51, 60, 48, 48, 43, 31, 39, 22, 15, 37, 32, 39, 60, 90, 82, 68, 63, 64, 58, 66, 51, 53, 48, 28, 34, 42, 24, 28, 39, 87, 96, 106, 124, 124, 135, 131, 131, 88, 91, 72, 96, 103, 83, 83, 81, 91
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.
Sequence in context: A072147 A190121 A105329 * A325262 A334906 A078471
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