OFFSET
1,1
FORMULA
1 + A234099.
a(n) = (A046389(n)+1)/2. - Chai Wah Wu, Oct 18 2024
EXAMPLE
53 = (3*5*7 + 1)/2.
MATHEMATICA
t = Select[Range[1, 10000, 2], Map[Last, FactorInteger[#]] == Table[1, {3}] &]; Take[(t + 1)/2, 120] (* A234102 *)
v = Flatten[Position[PrimeQ[(t + 1)/2], True]] ; w = Table[t[[v[[n]]]], {n, 1, Length[v]}] (* A234103 *)
(w + 1)/2 (* A234104 *) (* Peter J. C. Moses, Dec 23 2013 *)
PROG
(Python)
from math import isqrt
from sympy import primepi, primerange, integer_nthroot
def A234102(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(3, integer_nthroot(x, 3)[0]+1), 2) for b, m in enumerate(primerange(k+1, isqrt(x//k)+1), a+1)))
return bisection(f, n, n)+1>>1 # Chai Wah Wu, Oct 18 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Dec 27 2013
STATUS
approved