%I #16 Dec 30 2020 14:40:07
%S -1,0,1,0,-1,0,-1,0,1,0,1,2,1,0,1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,-1,0,
%T -1,-2,-1,-2,-1,0,-1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,-2,-1,0,-1,0,1,0,
%U -1,0,-1,0,1,0,1,2,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,1,0,1,2,1,0,1,0,1,2
%N Discrepancy of the Kolakoski sequence A000002.
%C The discrepancy is defined by a(n) = Sum_{i=1..n} (-1)^k(i), where k(i) = A000002(i). The negative of this sequence is already in the OEIS (A088568), but does not seem to be found if one looks up -1, 0, 1, 0, -1, 0, -1, 0, 1, 0, 1, ..., so this version has been added for completeness.
%C See A088568 for more information and references.
%H Rémy Sigrist, <a href="/A294448/b294448.txt">Table of n, a(n) for n = 1..10000</a>
%H Richard P. Brent, <a href="https://maths-people.anu.edu.au/~brent/pd/Kolakoski-UNSW.pdf">Fast algorithms for the Kolakoski sequence</a>, Slides from a talk, 2016.
%Y Cf. A000002, A088568.
%Y For records see A294449.
%K sign,look
%O 1,12
%A _N. J. A. Sloane_, Nov 21 2017