A076545 a(n) = Sum_{k=1..n} (mu(k) + sqf(k)) where mu(k) is Moebius function, sqf(k)=1 if k is squarefree and sqf(k)=-1 otherwise.
2, 2, 2, 1, 1, 3, 3, 2, 1, 3, 3, 2, 2, 4, 6, 5, 5, 4, 4, 3, 5, 7, 7, 6, 5, 7, 6, 5, 5, 5, 5, 4, 6, 8, 10, 9, 9, 11, 13, 12, 12, 12, 12, 11, 10, 12, 12, 11, 10, 9, 11, 10, 10, 9, 11, 10, 12, 14, 14, 13, 13, 15, 14, 13, 15, 15, 15, 14, 16, 16, 16, 15, 15, 17, 16, 15, 17, 17, 17, 16, 15
Offset: 1
Programs
-
Mathematica
Accumulate[Table[MoebiusMu[n]+If[SquareFreeQ[n],1,-1],{n,100}]] (* Harvey P. Dale, Jun 02 2022 *)