OFFSET
1,2
COMMENTS
Differs from A283262 by having the terms 1, 128, 1024, 2187, 8192, ..., and not having the terms 256, 512, 6561, ... .
1 and numbers of the form p^e where p is prime and e is a squarefree number.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Chai Wah Wu, Algorithms for Complementary Sequences, Integers (2025) Vol. 25, Art. No. A95. See p. 24.
MATHEMATICA
seq[lim_] := Module[{s = Select[Range[lim], !CompositeQ[#] &]}, Do[If[SquareFreeQ[i], s = Join[s, Select[Range[Surd[lim, i]], PrimeQ]^i]], {i, 2, Floor[Log2[lim]]}]; Sort[s]]; seq[250]
PROG
(Python)
from math import isqrt
from sympy import mobius, integer_log, primerange, primepi
def A384419(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
kmin = kmax >> 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid: kmax = kmid
else: kmin = kmid
return kmax
def g(x): return sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
def f(x): return n-1+x-sum(g(integer_log(x, p)[0])-1 for p in primerange(isqrt(x)+1))-primepi(x)
return bisection(f, n, n) # Chai Wah Wu, Sep 21 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, May 28 2025
STATUS
approved
