This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A268173 #38 Jan 25 2024 04:28:01 %S A268173 0,-1,0,-1,1,-1,1,-1,1,-2,1,-2,1,-2,1,-2,2,-2,2,-2,2,-2,2,-2,2,-3,2, %T A268173 -3,2,-3,2,-3,2,-3,2,-3,3,-3,3,-3,3,-3,3,-3,3,-3,3,-3,3,-4,3,-4,3,-4, %U A268173 3,-4,3,-4,3,-4,3,-4,3,-4,4,-4,4,-4,4,-4,4,-4,4,-4,4,-4,4,-4,4,-4,4 %N A268173 a(n) = Sum_{k=0..n} (-1)^k*floor(sqrt(k)). %H A268173 Andrew Howroyd, <a href="/A268173/b268173.txt">Table of n, a(n) for n = 0..1000</a> %F A268173 a(n) = floor(sqrt(n))*(-1)^n/2 - ((-1)^(floor(sqrt(n))+1)+1)/4. %F A268173 a(n) = (-1)^n * Sum_{i=1..ceiling(n/2)} c(n+2-2*i), where c is the square characteristic (A010052). - _Wesley Ivan Hurt_, Nov 26 2020 %F A268173 From _Ridouane Oudra_, Jan 21 2024: (Start) %F A268173 a(n) = (-1)^n*floor((sqrt(n) + (n mod 2))/2); %F A268173 a(2*n) = floor(sqrt(n/2)); %F A268173 a(2*n+1) = -floor(sqrt((n+1)/2) + 1/2). (End) %e A268173 a(5) = -1 = floor(sqrt(0)) - floor(sqrt(1)) + floor(sqrt(2)) - floor(sqrt(3)) + floor(sqrt(4)) - floor(sqrt(5)). %p A268173 seq(add((-1)^k*floor(sqrt(k)), k=0..n), n=0..80); # _Ridouane Oudra_, Jan 21 2024 %t A268173 Table[Sum[(-1)^k Floor[Sqrt@ k], {k, 0, n}], {n, 0, 50}] (* _Michael De Vlieger_, Mar 15 2016 *) %o A268173 (PARI) a(n) = sum(k=0, n, (-1)^k*sqrtint(k)); \\ _Michel Marcus_, Jan 28 2016 %o A268173 (PARI) a(n) = sqrtint(n)*(-1)^n/2-((-1)^(sqrtint(n)+1)+1)/4; \\ _John M. Campbell_, Mar 15 2016 %Y A268173 Cf. A022554, A031876, A032512, A032513, A032514, A032515, A032516, A032517, A032518, A032519, A032520, A032521. %K A268173 sign,easy %O A268173 0,10 %A A268173 _John M. Campbell_, Jan 28 2016 %E A268173 Terms a(55) and beyond from _Andrew Howroyd_, Mar 02 2020