OFFSET
1,2
COMMENTS
Alternate definition: n such that A000002(n) is different from A000002(n+1). - Nathaniel Johnston, May 02 2011
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
O. Bordelles and B. Cloitre, Bounds for the Kolakoski Sequence, J. Integer Sequences, 14 (2011), #11.2.1.
Bertran Steinsky, A Recursive Formula for the Kolakoski Sequence A000002, J. Integer Sequences, Vol. 9 (2006), Article 06.3.7.
FORMULA
a(n) = n + A074286(n) = 2*n - A156077(n) = A156077(n) + 2*A074286(n). - Jean-Christophe Hervé, Oct 05 2014
MATHEMATICA
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 *)
PROG
(Haskell)
a054353 n = a054353_list !! (n-1)
a054353_list = scanl1 (+) a000002_list
-- Reinhard Zumkeller, Aug 03 2013
(Python)
from itertools import accumulate
def alst(nn):
K = Kolakoski() # using Kolakoski() in A000002
return list(accumulate(next(K) for i in range(1, nn+1)))
print(alst(66)) # Michael S. Branicky, Jan 12 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 07 2000
STATUS
approved