OFFSET
1,6
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{d|n} mu(d)^2 * c(n/d^2), where c(n) = ceiling(n) - floor(n).
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
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jun 16 2021
STATUS
approved