OFFSET
1,1
COMMENTS
EXAMPLE
The sequence of terms together with their prime indices begins:
273: {2,4,6} 1869: {2,4,24} 3219: {2,10,12}
399: {2,4,8} 2067: {2,6,16} 3367: {4,6,12}
609: {2,4,10} 2109: {2,8,12} 3423: {2,4,38}
741: {2,6,8} 2121: {2,4,26} 3471: {2,6,24}
777: {2,4,12} 2247: {2,4,28} 3477: {2,8,18}
903: {2,4,14} 2373: {2,4,30} 3633: {2,4,40}
1113: {2,4,16} 2379: {2,6,18} 3741: {2,10,14}
1131: {2,6,10} 2451: {2,8,14} 3801: {2,4,42}
1281: {2,4,18} 2639: {4,6,10} 3857: {4,8,10}
1443: {2,6,12} 2751: {2,4,32} 3913: {4,6,14}
1491: {2,4,20} 2769: {2,6,20} 3939: {2,6,26}
1653: {2,8,10} 2919: {2,4,34} 4047: {2,8,20}
1659: {2,4,22} 3021: {2,8,16} 4053: {2,4,44}
1677: {2,6,14} 3081: {2,6,22} 4173: {2,6,28}
1729: {4,6,8} 3171: {2,4,36} 4179: {2,4,46}
MATHEMATICA
Select[Range[1000], SquareFreeQ[#]&&PrimeOmega[#]==3&&OddQ[Times@@(1+PrimePi/@First/@FactorInteger[#])]&]
PROG
(PARI) isok(m) = my(f=factor(m)); (bigomega(f)==3) && (omega(f)==3) && (#select(x->(x%2), apply(primepi, f[, 1]~)) == 0); \\ Michel Marcus, Nov 10 2020
(Python)
from itertools import filterfalse
from math import isqrt
from sympy import primepi, primerange, nextprime, integer_nthroot
def A338557(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))>>1)-(b>>1) for a, k in filterfalse(lambda x:x[0]&1, enumerate(primerange(3, integer_nthroot(x, 3)[0]+1), 2)) for b, m in filterfalse(lambda x:x[0]&1, enumerate(primerange(nextprime(k)+1, isqrt(x//k)+1), a+2))))
return bisection(f, n, n) # Chai Wah Wu, Oct 18 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 08 2020
STATUS
approved