|
|
A216345
|
|
Position of the beginning of the n-th run in A000002.
|
|
6
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
If n is odd then the run is 1's, otherwise it's 2's.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
Kolakoski sequence starts 1221121 so we can see that this sequence begins 1,2,4,6,7.
|
|
PROG
|
(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("<br>"); */
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);
(Haskell)
a216345 n = a216345_list !! (n-1)
a216345_list = 1 : (filter (\x -> a000002 x /= a000002 (x - 1)) [2..])
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|