login
A345371
Number of squarefree divisors of n whose square does not divide n.
1
0, 1, 1, 0, 1, 3, 1, 0, 0, 3, 1, 2, 1, 3, 3, 0, 1, 2, 1, 2, 3, 3, 1, 2, 0, 3, 0, 2, 1, 7, 1, 0, 3, 3, 3, 0, 1, 3, 3, 2, 1, 7, 1, 2, 2, 3, 1, 2, 0, 2, 3, 2, 1, 2, 3, 2, 3, 3, 1, 6, 1, 3, 2, 0, 3, 7, 1, 2, 3, 7, 1, 0, 1, 3, 2, 2, 3, 7, 1, 2, 0, 3, 1, 6, 3, 3, 3, 2, 1, 6, 3, 2, 3
OFFSET
1,6
LINKS
FORMULA
a(n) = Sum_{d|n} mu(d)^2 * c(n/d^2), where c(n) = ceiling(n) - floor(n).
a(n) = A034444(n) - A323308(n). - Amiram Eldar, Oct 13 2023
EXAMPLE
a(30) = Sum_{d|30} mu(d)^2 * c(30/d^2) = 1*0 + 1*1 + 1*1 + 1*1 + 1*1 + 1*1 + 1*1 + 1*1 = 7.
MATHEMATICA
a[n_] := DivisorSum[n, 1 &, SquareFreeQ[#] && ! Divisible[n, #^2] &]; Array[a, 100] (* Amiram Eldar, Oct 13 2023 *)
PROG
(PARI) a(n) = {my(e = factor(n)[, 2]); 1 << #e - vecprod(apply(x -> min(x, 2), e)); } \\ Amiram Eldar, Oct 13 2023
CROSSREFS
Sequence in context: A035654 A170846 A085604 * A306268 A354490 A365970
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jun 16 2021
STATUS
approved