OFFSET
1,2
FORMULA
a(n) = Sum_{j=0..n-1} abs(mu(n+j)).
a(1) = 1; a(n + 1) = a(n) - issquarefree(n) + issquarefree(2n-2) + issquarefree(2n-1) for n > 0. - David A. Corneth, May 20 2016
EXAMPLE
n=10: among numbers {10,...,19} seven are squarefree [10,11,13,14,15,17,19], so a(10)=7.
MATHEMATICA
Table[Apply[Plus, Table[Abs[MoebiusMu[w+j]], {j, 0, w-1}]], {w, 1, 128}]
Table[Count[Range[n, 2n-1], _?SquareFreeQ], {n, 80}] (* Harvey P. Dale, Oct 27 2013 *)
Module[{nn=80, sf}, sf=Table[If[SquareFreeQ[n], 1, 0], {n, 2nn}]; Table[Total[ Take[ sf, {i, 2i-1}]], {i, nn}]] (* Harvey P. Dale, May 20 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Nov 14 2002
STATUS
approved