Skip to content

Commit 1d9ce0d

Browse files
committed
Add "Kolakoski" holes
1 parent 7847e08 commit 1d9ce0d

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

db/a-schema.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ CREATE TYPE hole AS ENUM (
55
'12-days-of-christmas', '99-bottles-of-beer', 'abundant-numbers',
66
'arabic-to-roman', 'brainfuck', 'christmas-trees', 'css-colors', 'cubes',
77
'diamonds', 'divisors', 'emirp-numbers', 'emojify', 'evil-numbers',
8-
'fibonacci', 'fizz-buzz', 'happy-numbers', 'intersection', 'leap-years',
8+
'fibonacci', 'fizz-buzz', 'happy-numbers', 'intersection',
9+
'kolakoski-constant', 'kolakoski-sequence', 'leap-years',
910
'levenshtein-distance', 'leyland-numbers', 'look-and-say',
1011
'lucky-tickets', 'morse-decoder', 'morse-encoder', 'niven-numbers',
1112
'odious-numbers', 'ordinal-numbers', 'pangram-grep', 'pascals-triangle',

holes.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -794,44 +794,43 @@ preamble = '''
794794

795795
['Kolakoski Constant']
796796
category = 'Mathematics'
797-
experiment = -1
798797
links = [
799-
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Kolakoski_sequence#Kolakoski_Constant' }
798+
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Kolakoski_sequence#Kolakoski_Constant' },
800799
]
801800
preamble = '''
802801
<p>
803802
The Kolakoski constant is created by taking the
804-
<a href="kolakoski-sequence"> Kolakoski sequence </a>
805-
and subtracting one from each element then interpreting it as a binary fraction.
803+
<a href=kolakoski-sequence>Kolakoski sequence</a> and subtracting one from
804+
each element then interpreting it as a binary fraction.
806805
807806
<pre>
808807
1 221121221221121122121121…
809808
0.110010110110010011010010…
810809
0.7945071927…
811810
</pre>
812811
813-
<p> Print the Kolakoski constant to the first 1,000 decimal places </p>
812+
<p>Print the Kolakoski constant to the first 1,000 decimal places.
814813
'''
815814

816815
['Kolakoski Sequence']
817816
category = 'Sequence'
818-
experiment = -1
819817
links = [
818+
{ name = 'OEIS A000002', url = '//oeis.org/A000002' },
820819
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Kolakoski_sequence' },
821-
{ name = 'OEIS A000002', url = '//oeis.org/A000002' }
822820
]
823821
preamble = '''
824822
<p>
825-
The Kolakoski sequence is a self referential sequence where the nth element
826-
is the length of the nth run of same numbers in the sequence.
823+
The Kolakoski sequence is a self referential sequence where the nth
824+
element is the length of the nth run of same numbers in the sequence.
827825
This has the interesting property where if you take the run lengths of
828-
this sequence, then you will get the same sequence back again.
829-
For example, the sequence starting with (1, 2) looks like:
826+
this sequence, then you will get the same sequence back again. For
827+
example, the sequence starting with (1, 2) looks like:
830828
831829
<pre>
832830
1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1…
833831
1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1…
834832
</pre>
833+
835834
<p>
836835
Beginning with (1, 2) output the first 1000 elements in the Kolakoski
837836
sequence, separated by spaces.

0 commit comments

Comments
 (0)