%I #46 Jan 12 2021 12:58:53
%S 1,3,5,6,7,9,10,12,14,15,17,19,20,21,23,24,25,27,29,30,32,33,34,36,37,
%T 39,41,42,43,45,46,47,49,50,52,54,55,57,59,60,61,63,64,66,68,69,71,72,
%U 73,75,76,77,79,81,82,84,86,87,88,90,91,93,95,96,98,100
%N Partial sums of Kolakoski sequence A000002.
%C Alternate definition: n such that A000002(n) is different from A000002(n+1). - _Nathaniel Johnston_, May 02 2011
%H Nathaniel Johnston, <a href="/A054353/b054353.txt">Table of n, a(n) for n = 1..10000</a>
%H O. Bordelles and B. Cloitre, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL14/Bordelles/bordelles7r.html">Bounds for the Kolakoski Sequence</a>, J. Integer Sequences, 14 (2011), #11.2.1.
%H Bertran Steinsky, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL9/Steinsky/steinsky5.html">A Recursive Formula for the Kolakoski Sequence A000002</a>, J. Integer Sequences, Vol. 9 (2006), Article 06.3.7.
%F A000002(a(n)) = (3+(-1)^n)/2; A000002(a(n)+1)=(3-(-1)^n)/2. - _Benoit Cloitre_, Oct 16 2005
%F a(n) = n + A074286(n) = 2*n - A156077(n) = A156077(n) + 2*A074286(n). - _Jean-Christophe Hervé_, Oct 05 2014
%t a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1+Mod[n-1, 2]}], {n, 3, 50}, {a2[[n]] } ]; Accumulate[a2] (* _Jean-François Alcover_, Jun 18 2013 *)
%o (Haskell)
%o a054353 n = a054353_list !! (n-1)
%o a054353_list = scanl1 (+) a000002_list
%o -- _Reinhard Zumkeller_, Aug 03 2013
%o (Python)
%o from itertools import accumulate
%o def alst(nn):
%o K = Kolakoski() # using Kolakoski() in A000002
%o return list(accumulate(next(K) for i in range(1, nn+1)))
%o print(alst(66)) # _Michael S. Branicky_, Jan 12 2021
%Y Cf. A000002, A074272, A074286, A074288, A078649, A156077.
%Y Cf. A088568 (partial sums of [3 - 2*A000002(n)]).
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_, May 07 2000