%I M0060 #37 May 07 2024 02:26:04
%S 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,
%T 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,
%U 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
%N a(n) = 1 if n is squarefree, otherwise 2.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Antti Karttunen, <a href="/A007424/b007424.txt">Table of n, a(n) for n = 1..65537</a>
%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>.
%F a(n) = 2 - A008966(n). - _Antti Karttunen_, Nov 18 2017
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2 - 6/Pi^2 = 1 + A229099. - _Amiram Eldar_, Sep 26 2022
%F a(n) = A051903(A007948(n)) = A130130(A051903(n)) for n >= 2. - _Amiram Eldar_, May 07 2024
%t Table[If[SquareFreeQ[n],1,2],{n,100}] (* _Harvey P. Dale_, Jul 09 2014 *)
%o (MuPAD) func(2-abs(numlib::moebius(n)), n):
%o (PARI) A007424(n) = (2-issquarefree(n)); \\ _Antti Karttunen_, Nov 18 2017
%Y Cf. A005117, A008966, A107078, A229099.
%Y Cf. A007948, A051903, A130130.
%K easy,nonn
%O 1,4
%A _N. J. A. Sloane_