OFFSET
0,4
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Sum_{i=1..n} i*(-1)^tau(i), where tau(i) = A000005(i). - Ridouane Oudra, Oct 08 2019
a(n) = (1/6)*(3*n^2 + 3*n - 2*floor(sqrt(n)) - 6*floor(sqrt(n))^2 - 4*floor(sqrt(n))^3). - Ridouane Oudra, Aug 22 2021
MATHEMATICA
Accumulate[Table[If[IntegerQ[Sqrt[n]], -n, n], {n, 0, 70}]] (* Harvey P. Dale, Jan 17 2017 *)
PROG
(PARI) g(n) = my(s=0); for(x=0, n, if(issquare(x), s-=x, s+=x); print1(s, ", "))
(Magma) [0] cat [&+[i*(-1)^#Divisors(i):i in [1..n]]:n in [1..70]]; // Marius A. Burtea, Oct 09 2019
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Cino Hilliard, Jun 13 2005
STATUS
approved