Nothing Special   »   [go: up one dir, main page]

login
A123073
Number of ordered triples of primes (p,q,r) such that pqr = n-th 3-almost prime A014612(n).
3
1, 3, 3, 3, 1, 3, 6, 6, 3, 3, 3, 3, 3, 6, 3, 6, 3, 3, 6, 3, 3, 3, 6, 6, 6, 6, 3, 3, 3, 1, 6, 6, 3, 3, 3, 6, 3, 6, 6, 3, 3, 6, 3, 6, 6, 3, 6, 6, 3, 3, 6, 6, 6, 3, 6, 3, 3, 3, 6, 6, 6, 3, 6, 3, 6, 3, 3, 6, 3, 6, 6, 6, 3, 6, 3, 6, 6, 3, 3, 3, 3, 1, 6, 6, 3, 6, 3, 6, 3, 6, 6, 6, 3, 3, 6, 6, 3, 6, 6, 3, 6, 3, 3, 6, 3
OFFSET
1,2
COMMENTS
The nonzero subsequence of A123074.
PROG
(Python)
from math import isqrt
from sympy import primepi, primerange, integer_nthroot, primefactors
def A123073(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x): return int(n+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)))
return (1, 3, 6)[len(primefactors(bisection(f, n, n)))-1] # Chai Wah Wu, Oct 20 2024
CROSSREFS
Sequence in context: A181520 A256736 A372700 * A059289 A201277 A163644
KEYWORD
nonn
AUTHOR
N. J. A. Sloane and T. D. Noe, Sep 29 2006
EXTENSIONS
More terms from T. D. Noe, Sep 29 2006
STATUS
approved