A076998 Difference between cubefree and squarefree components of n.
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, 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, 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
Offset: 1
Examples
a(4)=2 as cubefree(4)=4 and squarefree(4)=2. 4-2=2
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
Mathematica
a[n_] := Module[{f = FactorInteger[n]}, Times @@ (First[#]^Min[Last[#], 2] & /@ f) - Times @@ (First[#] & /@ f)]; Array[a, 100] (* Amiram Eldar, Sep 24 2023 *)
-
PARI
rad(n)=local(p,i); p=factor(n)[,1]; prod(i=1,length(p),p[i]) 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])) for (k=1,100,print1(rad2(k)-rad(k)", "))
-
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
Formula
From Amiram Eldar, Sep 24 2023: (Start)
a(n) >= 0, with equality if and only if n is squarefree (A005117).