OFFSET
0,1
COMMENTS
LINKS
FORMULA
a(n) = 1 if n is a perfect square (A000290) or has some square > 1 as a factor, else 0.
a(0) = a(1) = 1; for n > 1, a(n) = 1 - A008966(n). - Antti Karttunen, Nov 17 2017
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=0..m} a(k) = 1 - 6/Pi^2 (A229099). - Amiram Eldar, Jan 19 2024
EXAMPLE
a(4) = 1 because 4 is a square; a(8) = 1 because 8 = 2^2 * 2.
MAPLE
1, 1, seq(`if`(numtheory:-issqrfree(n), 0, 1), n=2..100); # Robert Israel, Nov 17 2017
MATHEMATICA
Array[If[# <= 1, 1, 1 - Abs@ MoebiusMu@ #] &, 105, 0] (* Michael De Vlieger, Nov 17 2017 *)
PROG
(PARI) A087049(n) = if(n<=1, 1, 1-abs(moebius(n))); \\ Antti Karttunen, Nov 17 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wolfdieter Lang, Sep 08 2003
STATUS
approved