OFFSET
1,1
LINKS
Karl-Heinz Hofmann, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 4849845 = 3*5*7*11*13*17*19
a(9663) = 253808555 = 5*7*11*13*17*19*157
a(9961) = 258573315 = 3*5*7*11*13*17*1013
a(10000) = 259173915 = 3*5*7*11*13*41*421
PROG
(Python)
import numpy
from sympy import nextprime, sieve, primepi
k_upto = 14 * 10**6
array = numpy.zeros(k_upto, dtype="i4")
sieve_max_number = primepi(nextprime(k_upto // 255255))
for s in range(2, sieve_max_number):
array[sieve[s]:k_upto][::sieve[s]] += 1
for s in range(2, sieve_max_number):
array[sieve[s]**2:k_upto][::sieve[s]**2] = 0
print([k for k in range(1, k_upto, 2) if array[k] == 7])
(Python)
from math import prod, isqrt
from sympy import primerange, integer_nthroot, primepi
def A361075(n):
def g(x, a, b, c, m): yield from (((d, ) for d in enumerate(primerange(b+1, isqrt(x//c)+1), a+1)) if m==2 else (((a2, b2), )+d for a2, b2 in enumerate(primerange(b+1, integer_nthroot(x//c, m)[0]+1), a+1) for d in g(x, a2, b2, c*b2, m-1)))
def f(x): return int(n+x-sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x, 1, 2, 1, 7)))
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
return bisection(f, n, n) # Chai Wah Wu, Sep 10 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Karl-Heinz Hofmann, Mar 01 2023
STATUS
approved