Skip to content

Commit 7b70234

Browse files
committed
Enable Van Eck seq hole
1 parent 47ed85e commit 7b70234

2 files changed

Lines changed: 25 additions & 30 deletions

File tree

‎db/a-schema.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CREATE TYPE hole AS ENUM (
1414
'rock-paper-scissors-spock-lizard', 'roman-to-arabic', 'rule-110',
1515
'seven-segment', 'sierpiński-triangle', 'spelling-numbers', 'sudoku',
1616
'sudoku-v2', 'ten-pin-bowling', 'tongue-twisters', 'united-states',
17-
'vampire-numbers', 'λ', 'π', 'τ', 'φ', '√2', '𝑒'
17+
'vampire-numbers', 'van-eck-sequence', 'λ', 'π', 'τ', 'φ', '√2', '𝑒'
1818
);
1919

2020
CREATE TYPE keymap AS ENUM ('default', 'vim');

‎holes.toml‎

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ preamble = '''
13451345
['Recamán']
13461346
category = 'Sequence'
13471347
links = [
1348-
{ name = 'Numberphile', url = '//numberphile.com/videos/slightly-spooky-recaman-sequence' },
1348+
{ name = 'Numberphile', url = '//www.numberphile.com/videos/slightly-spooky-recaman-sequence' },
13491349
{ name = 'OEIS A005132', url = '//oeis.org/A005132'},
13501350
{ name = 'Rosetta Code', url = "//rosettacode.org/wiki/Recaman's_sequence" },
13511351
{ name = 'Wikipedia', url = "//www.wikipedia.org/wiki/Recamán's_sequence" },
@@ -1824,38 +1824,33 @@ preamble = '''
18241824

18251825
['Van Eck Sequence']
18261826
category = 'Sequence'
1827-
experiment = -1
18281827
links = [
1829-
{ name = 'OEIS A181391', url = 'https://oeis.org/A181391' },
1830-
{ name = 'Numberphile', url = 'https://www.youtube.com/watch?v=etMJxB-igrc' },
1831-
{ name = 'Rosetta Code', url = 'https://rosettacode.org/wiki/Van_Eck_sequence' },
1828+
{ name = 'Numberphile', url = '//www.numberphile.com/videos/van-eck-sequence' },
1829+
{ name = 'OEIS A181391', url = '//oeis.org/A181391' },
1830+
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Van_Eck_sequence' },
18321831
]
18331832
preamble = '''
1833+
<p>The rules of the Van Eck sequence are as follows:
1834+
1835+
<ol type=a>
1836+
<li>The first term is zero.
1837+
<li>If the last term is new then the next term is zero.
1838+
<li>Otherwise the next term is how far back the term occured previously.
1839+
</ol>
1840+
1841+
<p>The first few terms are as follows:
1842+
1843+
<pre>
1844+
0 (using a)
1845+
0 0 (using b)
1846+
0 0 1 (using c)
1847+
0 0 1 0 (using b)
1848+
0 0 1 0 2 (using c)
1849+
</pre>
1850+
18341851
<p>
1835-
The rules of the Van Eck sequence are as follows: If the previous number has not occurred
1836-
in the sequence before, then the next number is 0. If the previous number has occurred
1837-
in the sequence before, then the next number is the number of steps back to that occurrence.
1838-
<p>
1839-
The sequence starts with 0.
1840-
<p>
1841-
<b>Example</b>
1842-
<p>
1843-
Consider the sequence:
1844-
<p>
1845-
0 0 1 0 2
1846-
<p>
1847-
The last number is a 2, which does not appear previously in the rest of the sequence.
1848-
Thus, the next number will be 0.
1849-
<p>
1850-
Consider another sequence:
1851-
<p>
1852-
0 0 1 0 2 0 2 2 1
1853-
<p>
1854-
The last number is a 1, which does appear previously in the sequence. The most recent
1855-
previous 1 is six steps back from this 1, so the next number will be 6.
1856-
1857-
<p>
1858-
Print the first <b>1000</b> terms of the Van Eck sequence, with each number on a new line.
1852+
Print the first <b>1000</b> terms of the Van Eck sequence, with each term
1853+
on a new line.
18591854
'''
18601855

18611856

0 commit comments

Comments
 (0)