login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007424 a(n) = 1 if n is squarefree, otherwise 2.
(Formerly M0060)
5
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
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
MATHEMATICA
f[n_]:=Union[Last/@FactorInteger[n]][[ -1]]; lst={1}; Do[If[f[n]==1, AppendTo[lst, 1], AppendTo[lst, 2]], {n, 2, 6!}]; lst (* Vladimir Joseph Stephan Orlovsky, Mar 07 2010 *)
Table[If[SquareFreeQ[n], 1, 2], {n, 100}] (* Harvey P. Dale, Jul 09 2014 *)
PROG
(MuPAD) func(2-abs(numlib::moebius(n)), n):
(PARI) A007424(n) = (2-issquarefree(n)); \\ Antti Karttunen, Nov 18 2017
CROSSREFS
Sequence in context: A194799 A291119 A366309 * A369163 A323308 A365549
KEYWORD
easy,nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 3 07:46 EDT 2024. Contains 372206 sequences. (Running on oeis4.)