Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #13 Oct 06 2023 10:54:45
%S 0,1,1,2,1,2,1,3,2,2,1,4,1,2,2,4,1,4,1,4,2,2,1,6,2,2,3,4,1,3,1,5,2,2,
%T 2,7,1,2,2,6,1,3,1,4,4,2,1,8,2,4,2,4,1,6,2,6,2,2,1,7,1,2,4,6,2,3,1,4,
%U 2,3,1,10,1,2,4,4,2,3,1,8,4,2,1,7,2,2,2,6,1,7,2,4,2,2,2
%N Number of divisors of n that are either prime or have at least one square divisor > 1.
%H Amiram Eldar, <a href="/A351417/b351417.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>
%F a(n) = Sum_{d|n} [[Omega(d) = 1] = mu(d)^2], where [ ] is the Iverson bracket.
%F a(n) = A048105(n) + A001221(n). - _Amiram Eldar_, Oct 06 2023
%e a(96) = 10; 96 has divisors 2,3 (prime) and 4,8,12,16,24,32,48,96 (all with at least one square divisor > 1).
%t a[n_] := Module[{e = FactorInteger[n][[;;, 2]], nu}, nu = Length[e]; Times @@ (e+1) - 2^nu + nu]; a[1] = 0; Array[a, 100] (* _Amiram Eldar_, Oct 06 2023 *)
%o (PARI) a(n) = {my(f = factor(n), d = numdiv(f), nu = omega(f)); d - 2^nu + nu;} \\ _Amiram Eldar_, Oct 06 2023
%Y Cf. A001221 (omega), A001222 (Omega, aka bigomega), A008683 (mu), A048105.
%K nonn,easy
%O 1,4
%A _Wesley Ivan Hurt_, Feb 10 2022