login
A076998
Difference between cubefree and squarefree components of n.
3
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,4
LINKS
FORMULA
a(n) = A007948(n) - A007947(n). - Antti Karttunen, Jul 21 2018
From Amiram Eldar, Sep 24 2023: (Start)
a(n) >= 0, with equality if and only if n is squarefree (A005117).
Sum_{k=1..n} a(k) ~ (1/2) * c * n^2, where c = A065465 - A065463 = 0.17707163872600518419... . (End)
EXAMPLE
a(4)=2 as cubefree(4)=4 and squarefree(4)=2. 4-2=2
MATHEMATICA
a[n_] := Module[{f = FactorInteger[n]}, Times @@ (First[#]^Min[Last[#], 2] & /@ f) - Times @@ (First[#] & /@ f)]; Array[a, 100] (* Amiram Eldar, Sep 24 2023 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jon Perry, Nov 28 2002
STATUS
approved