login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Difference between cubefree and squarefree components of n.
3

%I #15 Sep 24 2023 05:43:52

%S 0,0,0,2,0,0,0,2,6,0,0,6,0,0,0,2,0,12,0,10,0,0,0,6,20,0,6,14,0,0,0,2,

%T 0,0,0,30,0,0,0,10,0,0,0,22,30,0,0,6,42,40,0,26,0,12,0,14,0,0,0,30,0,

%U 0,42,2,0,0,0,34,0,0,0,30,0,0,60,38,0,0,0,10,6,0,0,42,0,0,0,22,0,60,0,46

%N Difference between cubefree and squarefree components of n.

%H Antti Karttunen, <a href="/A076998/b076998.txt">Table of n, a(n) for n = 1..65537</a>

%F a(n) = A007948(n) - A007947(n). - _Antti Karttunen_, Jul 21 2018

%F From _Amiram Eldar_, Sep 24 2023: (Start)

%F a(n) >= 0, with equality if and only if n is squarefree (A005117).

%F Sum_{k=1..n} a(k) ~ (1/2) * c * n^2, where c = A065465 - A065463 = 0.17707163872600518419... . (End)

%e a(4)=2 as cubefree(4)=4 and squarefree(4)=2. 4-2=2

%t a[n_] := Module[{f = FactorInteger[n]}, Times @@ (First[#]^Min[Last[#], 2] & /@ f) - Times @@ (First[#] & /@ f)]; Array[a, 100] (* _Amiram Eldar_, Sep 24 2023 *)

%o (PARI) rad(n)=local(p,i); p=factor(n)[,1]; prod(i=1,length(p),p[i])

%o rad2(n)=local(p,pn,i); p=factor(n)[,1]; pn=factor(n)[,2]; prod(i=1,length(p),p[i]^min(2,pn[i]))

%o for (k=1,100,print1(rad2(k)-rad(k)", "))

%o (PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, f[i,1]^min(f[i,2],2)) - vecprod(f[,1]);} \\ _Amiram Eldar_, Sep 24 2023

%Y Cf. A005117, A007947, A007948.

%Y Cf. A065463, A065465.

%K nonn,easy

%O 1,4

%A _Jon Perry_, Nov 28 2002