OFFSET
1,8
LINKS
FORMULA
a(n) = Sum_{d|n} [c(d) = mu(d)^2], where [ ] is the Iverson bracket and c is the characteristic function of squares (A010052).
EXAMPLE
a(96) = 7; 96 has the trivial divisor (=1), and the 6 divisors 8,12,24,32,48,96 which all have a square divisor > 1 but are not themselves square.
MATHEMATICA
a[n_] := Module[{e = FactorInteger[n][[;; , 2]]}, Times @@ (e + 1) - 2^Length[e] - Times @@ (1 + Floor[e/2]) + 2]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Oct 06 2023 *)
PROG
(PARI) a(n) = {my(f = factor(n), e = f[, 2], d = numdiv(f), nu = omega(f)); d - 2^nu - vecprod(apply(x -> x\2 + 1, e)) + 2; } \\ Amiram Eldar, Oct 06 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Feb 11 2022
STATUS
approved