OFFSET
1,2
LINKS
FORMULA
a(n) = Sum_{d|n} sign(mu(d)^2 + [omega(d) = 1]).
a(n) = Sum_{d|n} (mu(d)^2 + [omega(d) = 1]*(1 - mu(d)^2)).
EXAMPLE
a(36) = 6; 36 has 4 squarefree divisors 1,2,3,6 (where the primes 2 and 3 are both squarefree and 1st powers of primes) and 2 (additional) divisors that are powers of primes, 2^2 and 3^2.
MATHEMATICA
a[n_] := Module[{e = FactorInteger[n][[;; , 2]], nu, omega}, nu = Length[e]; omega = Total[e]; 2^nu + omega - nu]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Oct 06 2023 *)
PROG
(PARI) a(n) = {my(f = factor(n), nu = omega(f), om = bigomega(f)); 2^nu + om - nu; } \\ Amiram Eldar, Oct 06 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Feb 09 2022
STATUS
approved