OFFSET
1,1
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
EXAMPLE
The Kolakoski sequence begins 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,1,2,2,1,2,..., so 1,2,2,1,2 occurs at positions 7 and 17.
MATHEMATICA
a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1 + Mod[n - 1, 2]}], {n, 3, 400}, {i, 1, a2[[n]]}]; a2 //. {a___, 1, 2, 2, 1, 2, b___} :> {a, 0, 2, 2, 1, 2, b} // Flatten // Position[#, 0] & // Flatten (* Jean-François Alcover, Jun 18 2013 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jon Perry, Sep 21 2002
EXTENSIONS
Extended and offset corrected by Nathaniel Johnston, May 02 2011
STATUS
approved