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.

A007424 a(n) = 1 if n is squarefree, otherwise 2.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Table[If[SquareFreeQ[n],1,2],{n,100}] (* Harvey P. Dale, Jul 09 2014 *)
  • MuPAD
    func(2-abs(numlib::moebius(n)), n):
    
  • PARI
    A007424(n) = (2-issquarefree(n)); \\ Antti Karttunen, Nov 18 2017

Formula

a(n) = 2 - A008966(n). - Antti Karttunen, Nov 18 2017
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2 - 6/Pi^2 = 1 + A229099. - Amiram Eldar, Sep 26 2022
a(n) = A051903(A007948(n)) = A130130(A051903(n)) for n >= 2. - Amiram Eldar, May 07 2024