login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Positions of '22' in Kolakoski sequence A000002.
6

%I #10 Jun 18 2013 06:06:38

%S 2,8,11,18,26,35,38,44,53,56,62,65,74,80,83,89,92,99,107,110,119,126,

%T 135,138,144,150,153,162,165,171,180,188,197,203,206,212,215,224,231,

%U 234,242,249,258,261,269,278,281,287,296,299,305,308,314,317,324,332

%N Positions of '22' in Kolakoski sequence A000002.

%H Nathaniel Johnston, <a href="/A074263/b074263.txt">Table of n, a(n) for n = 1..10000</a>

%e Kolakoski sequence begins 1,2,2,1,1,2,1,2,2,1,2,2,1,1,... so the sequence includes 2, 8, and 11.

%t a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1 + Mod[n - 1, 2]}], {n, 3, 300}, {i, 1, a2[[n]]}]; Split[a2] /. {2, 2} -> {0, 2} // Flatten // Position[#, 0] & // Flatten (* _Jean-François Alcover_, Jun 18 2013 *)

%Y Cf. A074262.

%K nonn,easy

%O 1,1

%A _Jon Perry_, Sep 20 2002

%E Extended and offset changed by _Nathaniel Johnston_, May 02 2011