login
Number of divisors of n that are either of the form p^k (p prime, k>1) or are nonprime squarefree numbers.
1

%I #10 Oct 06 2023 10:55:07

%S 1,1,1,2,1,2,1,3,2,2,1,3,1,2,2,4,1,3,1,3,2,2,1,4,2,2,3,3,1,5,1,5,2,2,

%T 2,4,1,2,2,4,1,5,1,3,3,2,1,5,2,3,2,3,1,4,2,4,2,2,1,6,1,2,3,6,2,5,1,3,

%U 2,5,1,5,1,2,3,3,2,5,1,5,4,2,1,6,2,2,2,4,1,6,2,3,2,2,2

%N Number of divisors of n that are either of the form p^k (p prime, k>1) or are nonprime squarefree numbers.

%H Amiram Eldar, <a href="/A351418/b351418.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] = (1-mu(d)^2)], where [ ] is the Iverson bracket.

%F a(n) = A034444(n) - 2*A001221(n) + A001222(n). - _Amiram Eldar_, Oct 06 2023

%e a(60) = 6; 30 has the divisors 1,6,10,15,30 (nonprime squarefree numbers), and 4 = 2^2 (which is of the form p^k, k>1).

%t a[n_] := Module[{e = FactorInteger[n][[;; , 2]], nu}, nu = Length[e]; 2^nu - 2*nu + Total[e]]; a[1] = 1; Array[a, 100] (* _Amiram Eldar_, Oct 06 2023 *)

%o (PARI) a(n) = {my(f = factor(n), nu = omega(f), om = bigomega(f)); 2^nu - 2*nu + om;} \\ _Amiram Eldar_, Oct 06 2023

%Y Cf. A001221 (omega), A001222 (bigomega), A008683 (mu), A034444.

%K nonn,easy

%O 1,4

%A _Wesley Ivan Hurt_, Feb 10 2022