A216345 Position of the beginning of the n-th run in A000002.
1, 2, 4, 6, 7, 8, 10, 11, 13, 15, 16, 18, 20, 21, 22, 24, 25, 26, 28, 30, 31, 33, 34, 35, 37, 38, 40, 42, 43, 44, 46, 47, 48, 50, 51, 53, 55, 56, 58, 60, 61, 62, 64, 65, 67, 69, 70, 72, 73, 74, 76, 77, 78, 80, 82, 83, 85, 87, 88, 89, 91, 92, 94, 96, 97, 99, 101, 102, 103
Offset: 1
Keywords
Examples
Kolakoski sequence starts 1221121 so we can see that this sequence begins 1,2,4,6,7.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a216345 n = a216345_list !! (n-1) a216345_list = 1 : (filter (\x -> a000002 x /= a000002 (x - 1)) [2..]) -- Reinhard Zumkeller, Aug 03 2013
-
JavaScript
a=new Array(); a[1]=1; a[2]=2; a[3]=2; cd=1; ap=3; for (i=4; i<50; i++) { if (a[ap]==1) a[i]=cd; else {a[i]=cd; a[i+1]=cd; i++} ap++; cd=3-cd; } /* document.write(a); document.write("
"); */ b=new Array(); b[1]=1; c=2; for (i=2; i<50; i++) if (a[i]!=a[i-1]) b[c++]=i; document.write(b);
Formula
{n: A156728(n-1)=1}. - R. J. Mathar, Sep 14 2012
Comments