OFFSET
1,2
COMMENTS
The sum of the reciprocals of all the terms of this sequence is Pi^2/6 (A013661).
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Eckford Cohen, A property of Dedekind's psi-function, Proceedings of the American Mathematical Society, Vol. 12, No. 6 (1961), p. 996.
MATHEMATICA
psi[1]=1; psi[n_] := n * Times@@(1+1/Transpose[FactorInteger[n]][[1]]); psi /@ Join[{1}, Select[Range@ 1200, Min@ FactorInteger[#][[All, 2]] > 1 &]] (* after T. D. Noe at A001615 and Harvey P. Dale at A001694 *)
PROG
(Python)
from math import isqrt, prod
from sympy import mobius, integer_nthroot, primefactors
def A323332(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-squarefreepi(integer_nthroot(x, 3)[0]), 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)
return c+l
a = primefactors(m:=bisection(f, n, n))
return m*prod(p+1 for p in a)//prod(a) # Chai Wah Wu, Sep 14 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Jan 11 2019
STATUS
approved