Anonymous user
Kolakoski sequence: Difference between revisions
m
fmt, series-> sequence
m (fmt.) |
m (fmt, series-> sequence) |
||
Line 1:
{{draft task}}
The [[wp:Kolakoski sequence|Kolakoski sequence]] is an infinite sequence of [[wp:Natural number|natural numbers]], (excluding zero); with the property that:
: ''if you form a new sequence from the counts of runs of the same number in the first
;Example:
Line 17:
;Creating a Kolakoski sequence:
# We start the sequence <code>s</code> with the first item from the cycle <code>c</code>:<br> <code>1</code>
Line 27:
<ol start="3">
<li><p>Increment <code>k</code></p></li>
<li><p>Get the next item from <code>c</code> and append it to the end of
<li><p><code>k</code> was moved to the second item in the list and <code>s[k]</code> states that it should appear two times, so append another of the last item to the
<li><p>Increment <code>k</code></p></li>
<li><p>Append the next item from the cycle to the list:<br> <code>1, 2,2, 1</code></p></li>
<li><p><code>k</code> is now at the third item in the list that states that the last item should appear twice so add another copy of the last item to the
<li><p>increment k</p></li></ol>
|