OFFSET
1,4
LINKS
FORMULA
a(n) = Sum_{i=1..n} (2*n - i) * (1 - mu(i)^2), where mu is the Möbius function (A008683).
MAPLE
N:= 100: # to get a(1)..a(N)
S:= ListTools:-PartialSums(map(t -> `if`(numtheory:-issqrfree(t), [0, 0], [1, t]), [$1..N])):
seq(2*n*S[n, 1]-S[n, 2], n=1..N); # Robert Israel, Oct 27 2017
MATHEMATICA
Table[Sum[(2 n - k) (1 - MoebiusMu[k]^2), {k, n}], {n, 80}]
Table[Total[Select[IntegerPartitions[2 n, {2}], !SquareFreeQ[#[[2]]]&][[;; , 1]]], {n, 60}] (* Harvey P. Dale, Apr 09 2023 *)
PROG
(PARI) a(n) = sum(i=1, n, (2*n-i)*(1-moebius(i)^2)); \\ Michel Marcus, Oct 27 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 25 2017
STATUS
approved