|
|
A007424
|
|
a(n) = 1 if n is squarefree, otherwise 2.
(Formerly M0060)
|
|
2
|
|
|
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
|
Antti Karttunen, Table of n, a(n) for n = 1..65537
Index entries for sequences computed from exponents in factorization of n
|
|
FORMULA
|
a(n) = 2 - A008966(n). - Antti Karttunen, Nov 18 2017
|
|
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
|
Cf. A005117, A008966, A107078.
Sequence in context: A037306 A194799 A291119 * A323308 A278908 A307848
Adjacent sequences: A007421 A007422 A007423 * A007425 A007426 A007427
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
N. J. A. Sloane
|
|
STATUS
|
approved
|
|
|
|