OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
MATHEMATICA
Table[If[Min[(f = FactorInteger[n])[[;; , 2]]] > 1 || n == 1, f[[1, 1]], Nothing], {n, 1, 3000}] (* Amiram Eldar, Jan 30 2023 *)
PROG
(Haskell)
a258567 = a020639 . a001694
(Python)
from math import isqrt
from sympy import mobius, integer_nthroot, primefactors
def A258567(n):
def squarefreepi(n):
return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1)))
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):
c, l = n+x, 0
j = isqrt(x)
while j>1:
k2 = integer_nthroot(x//j**2, 3)[0]+1
w = squarefreepi(k2-1)
c -= j*(w-l)
l, j = w, isqrt(x//k2**3)
c -= squarefreepi(integer_nthroot(x, 3)[0])-l
return c
return min(primefactors(bisection(f, n, n)), default=1) # Chai Wah Wu, Sep 10 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jun 06 2015
EXTENSIONS
Definition made more precise by N. J. A. Sloane, Apr 29 2024
STATUS
approved