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,..., so 2,1,1,2,1 occurs at positions 3 and 12.
MATHEMATICA
a2 = {1, 2, 2}; Do[a2 = Join[a2, {1 + Mod[n - 1, 2]}], {n, 3, 400}, {i, 1, a2[[n]]}]; a2 //. {a___, 2, 1, 1, 2, 1, b___} :> {a, 0, 1, 1, 2, 1, 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