OFFSET
0,28
FORMULA
a(n) = floor(n^(1/3))*(-1)^n/2 - ((-1)^(floor(n^(1/3))+1)+1)/4.
EXAMPLE
a(5) = [0^(1/3)]-[1^(1/3)]+[2^(1/3)]-[3^(1/3)]+[4^(1/3)]-[5^(1/3)] = 0-1+1-1+1-1 = -1, letting [] denote the floor function.
MATHEMATICA
Print[Table[Sum[(-1)^i*Floor[i^(1/3)], {i, 0, n}], {n, 0, 100}]]
PROG
(PARI) a(n)=sum(i=0, n, (-1)^i*sqrtnint(i, 3))
(PARI) a(n)=sqrtnint(n, 3)*(-1)^n/2-((-1)^(sqrtnint(n, 3)+1)+1)/4
CROSSREFS
KEYWORD
sign,easy
AUTHOR
John M. Campbell, Mar 15 2016
STATUS
approved