cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A087049 Characteristic sequence for numbers n>=0 that are either squares or have a square > 1 as factor.

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Sep 08 2003

Keywords

Comments

a(0)=1, a(1)=1, n>=2: a(n)=1 if isquarefree(n)=false else 0.
Except for a(0)=1 and a(1)=1 this is the bit-flipped unsigned Moebius sequence abs(A008683(n)), n>=2.
For n>=2: a(n)=1 iff n is from A013929 (not squarefree).

Examples

			a(4) = 1 because 4 is a square; a(8) = 1 because 8 = 2^2 * 2.
		

Crossrefs

Cf. A008683, A008966, A080733, A000290 (squares), A013929 (not squarefree), A229099.

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