OFFSET
1,1
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Fixed Point
Eric Weisstein's World of Mathematics, Map
PROG
(Scheme)
(define A182853 (MATCHING-POS 1 1 (lambda (n) (= 3 (A182850 n))))) ;; After the alternative definition of the sequence given by the original author. Requires also MATCHING-POS macro from my IntSeq-library - Antti Karttunen, Feb 05 2016
(PARI) isoka(n) = (omega(n) > 1) && issquarefree(n); \\ A120944
isok(n) = isoka(n) || (ispower(n, , &k) && isoka(k)); \\ Michel Marcus, Jun 24 2017
(Python)
from math import isqrt
from sympy import mobius, primepi, integer_nthroot
def A182853(n):
def g(x): return int(sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))-primepi(x))
def f(x): return n-2+x+(y:=x.bit_length())-sum(g(integer_nthroot(x, k)[0]) for k in range(1, y))
kmin, kmax = 1, 2
while f(kmax) >= kmax:
kmax <<= 1
while True:
kmid = kmax+kmin>>1
if f(kmid) < kmid:
kmax = kmid
else:
kmin = kmid
if kmax-kmin <= 1:
break
return kmax # Chai Wah Wu, Aug 19 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Matthew Vandermast, Jan 04 2011
STATUS
approved