login
A262352
a(n) = Sum_{k=0..n} (-1)^k*floor(k^(1/4)).
1
0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1
OFFSET
0,82
FORMULA
a(n) = floor(n^(1/4))*(-1)^n/2-((-1)^(floor(n^(1/4))+1)+1)/4.
EXAMPLE
Letting [] denote the floor function, a(7) = [0^(1/4)] - [1^(1/4)] + [2^(1/4)] - [3^(1/4)] + [4^(1/4)] - [5^(1/4)] + [6^(1/4)] - [7^(1/4)] = 0 - 1 + 1 - 1 + 1 - 1 + 1 - 1 = -1.
MATHEMATICA
Print[Table[Sum[(-1)^k*Floor[k^(1/4)], {k, 0, n}], {n, 0, 100}]] ;
PROG
(PARI) a(n)=floor(n^(1/4))*(-1)^n/2-((-1)^(floor(n^(1/4))+1)+1)/4
(PARI) a(n)=sum(k=0, n, (-1)^k*floor(k^(1/4)))
(PARI) A262352(n) = sum(k=0, n, ((-1)^k)*sqrtnint(k, 4)); \\ Antti Karttunen, Nov 06 2018
KEYWORD
sign,easy
AUTHOR
John M. Campbell, Mar 24 2016
EXTENSIONS
More terms from Antti Karttunen, Nov 06 2018
STATUS
approved