A087049 Characteristic sequence for numbers n>=0 that are either squares or have a square > 1 as factor.
1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1
Offset: 0
Examples
a(4) = 1 because 4 is a square; a(8) = 1 because 8 = 2^2 * 2.
Links
Programs
-
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 *)
-
PARI
A087049(n) = if(n<=1,1,1-abs(moebius(n))); \\ Antti Karttunen, Nov 17 2017
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
Comments