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