%I #20 May 08 2016 14:20:11
%S 1,2,2,3,3,5,3,4,4,7,4,8,4,7,7,6,5,10,5,10,8,9,5,11,7,10,8,11,6,18,6,
%T 9,10,11,10,15,7,12,11,14,7,20,7,13,13,12,7,16,9,17,13,15,8,19,13,16,
%U 13,14,8,27,8,14,15,13,14,25,9,16,14,25,9,21,9,16,18,17,14,27,9,20,14,17
%N Number of k, 1<=k<=n, such that core(k) divides n, where core(x) is the squarefree part of x, the smallest integer such that x*core(x) is a square.
%C Sequence does not give the number of all integers of the form core(k) dividing n since this set is infinite (for any square x^2 core(x^2)=1 divides n).
%H Giovanni Resta, <a href="/A069933/b069933.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = Sum_{1<=k<=n,(n,k)=1} (-1)^bigomega(k)*floor(n/k). - _Benoit Cloitre_, May 07 2016
%t core[n_] := core[n] = Block[{t = Transpose@ FactorInteger@n}, Times @@ (t[[1]]^Mod[t[[2]], 2])]; a[n_] := Length@ Select[Range@n, Mod[n, core@#] == 0 &]; Array[a, 1000] (* _Giovanni Resta_, May 07 2016 *)
%o (PARI) a(n)=sum(i=1,n,if(n%core(i),0,1)) \\ _Benoit Cloitre_, May 07 2016
%o (PARI) a(n)=sum(k=1,n,if(gcd(n,k)-1,0,(-1)^bigomega(k)*(n\k))) \\ _Benoit Cloitre_, May 07 2016
%o (Sage)
%o a = sloane.A001222
%o [sum([n//k*(-1)^a(k) for k in (1..n) if gcd(k,n) == 1]) for n in (1..82)] # _Peter Luschny_, May 08 2016
%Y Cf. A007913.
%K easy,nonn
%O 1,2
%A _Benoit Cloitre_, May 05 2002
|