[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
login
Number of divisors of n that are either trivial or are nonsquares with a square divisor > 1.
1

%I #50 Oct 06 2023 10:54:22

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

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

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

%N Number of divisors of n that are either trivial or are nonsquares with a square divisor > 1.

%H Amiram Eldar, <a href="/A351408/b351408.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} [c(d) = mu(d)^2], where [ ] is the Iverson bracket and c is the characteristic function of squares (A010052).

%F a(n) = A048105(n) - A046951(n) + 2. - _Amiram Eldar_, Oct 06 2023

%e 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.

%t 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 *)

%o (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

%Y Cf. A008683 (mu), A010052, A046951, A048105.

%K nonn,easy

%O 1,8

%A _Wesley Ivan Hurt_, Feb 11 2022