ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 13 Nov 2014 01:20:05 +0100A defect in the first_terms function in the OEIS modulehttps://ask.sagemath.org/question/24847/a-defect-in-the-first_terms-function-in-the-oeis-module/ oeis(17).first_terms(12)
throws the
TypeError: You found a sign inconsistency, please contact OEIS
The sequence [A000017](https://oeis.org/A000017) is 'dead', what means it has errors in the data and was replaced by another version. It is policy of the OEIS to keep such sequences so they can be found in the case they are referenced in the literature.
I think the OEIS functions should simply ignore sequences with the keyword 'dead'. At least they should not attempt to return terms of these sequences.
Wed, 12 Nov 2014 23:58:49 +0100https://ask.sagemath.org/question/24847/a-defect-in-the-first_terms-function-in-the-oeis-module/Comment by vdelecroix for <pre><code>oeis(17).first_terms(12)
</code></pre>
<p>throws the </p>
<pre><code>TypeError: You found a sign inconsistency, please contact OEIS
</code></pre>
<p>The sequence <a href="https://oeis.org/A000017">A000017</a> is 'dead', what means it has errors in the data and was replaced by another version. It is policy of the OEIS to keep such sequences so they can be found in the case they are referenced in the literature. </p>
<p>I think the OEIS functions should simply ignore sequences with the keyword 'dead'. At least they should not attempt to return terms of these sequences.</p>
https://ask.sagemath.org/question/24847/a-defect-in-the-first_terms-function-in-the-oeis-module/?comment=24848#post-id-24848Hi. You are definitely right! Thanks for the report. This is not really a question though. Do you know how to open a ticket (http://trac.sagemath.org)? If you have time and you know how to fix it, you are very welcome to contribute...Thu, 13 Nov 2014 00:39:23 +0100https://ask.sagemath.org/question/24847/a-defect-in-the-first_terms-function-in-the-oeis-module/?comment=24848#post-id-24848Comment by Peter Luschny for <pre><code>oeis(17).first_terms(12)
</code></pre>
<p>throws the </p>
<pre><code>TypeError: You found a sign inconsistency, please contact OEIS
</code></pre>
<p>The sequence <a href="https://oeis.org/A000017">A000017</a> is 'dead', what means it has errors in the data and was replaced by another version. It is policy of the OEIS to keep such sequences so they can be found in the case they are referenced in the literature. </p>
<p>I think the OEIS functions should simply ignore sequences with the keyword 'dead'. At least they should not attempt to return terms of these sequences.</p>
https://ask.sagemath.org/question/24847/a-defect-in-the-first_terms-function-in-the-oeis-module/?comment=24850#post-id-24850Yes, you are right, this is not a real question, sorry. I have opened now the ticket http://trac.sagemath.org/ticket/17330#ticketThu, 13 Nov 2014 00:57:41 +0100https://ask.sagemath.org/question/24847/a-defect-in-the-first_terms-function-in-the-oeis-module/?comment=24850#post-id-24850Answer by tmonteil for <pre><code>oeis(17).first_terms(12)
</code></pre>
<p>throws the </p>
<pre><code>TypeError: You found a sign inconsistency, please contact OEIS
</code></pre>
<p>The sequence <a href="https://oeis.org/A000017">A000017</a> is 'dead', what means it has errors in the data and was replaced by another version. It is policy of the OEIS to keep such sequences so they can be found in the case they are referenced in the literature. </p>
<p>I think the OEIS functions should simply ignore sequences with the keyword 'dead'. At least they should not attempt to return terms of these sequences.</p>
https://ask.sagemath.org/question/24847/a-defect-in-the-first_terms-function-in-the-oeis-module/?answer=24851#post-id-24851Great, i am happy this error happens, some detection procedure worked ! In this case, Sage's OEIS module refuses to provide the first terms because of an inconsistency in the database : there is not enough information in the keywords to decide whether the sequence is signed or not. When the module was written, the keyword ``dead`` was not specified (or perhaps i missed it!), which explains that it is not specifically handled. What is handled here is the lack of other keywords that have been removed. I tried to follow strictly the keyword specifications, since they determine the behavior of the sequence as a Sage object. It is indeed not so hard to fix, so as suggested by @vdelecroix, you could try to fix this if you want, and ask for help if needed.
If you are maintaining the (upstream) OEIS, may i take the opportunity to advocate some improvements in those keywords. For example, there is a ``finit`` keyword to ensure that the sequence is finite, but no keyword to claim "we know that this sequence is infinite", hence no distinction can be done between, for example, the Fibonacci sequence (A000045) which is known to be infinite and the twin primes (A001359), whose finiteness is an open problem, which leads to the following poor behavior:
sage: oeis(45).is_finite()
Unknown
While we should be able to answer ``False``.
Also, i do not remember precisely which sequences, but i noticed that some keywords are used in a weaker sense than their specification. For example ``cofr`` means that the sequence is the sequence of convergents of some particular number. Unfortunately, it is sometimes used for a sequence of digits of an irrational number whose definition involves continued fractions, or the sequence of denominators of the approximants of the continued fraction. In such case, it makes no sense anymore to transform the sequence into a continued fraction.
Thu, 13 Nov 2014 01:20:05 +0100https://ask.sagemath.org/question/24847/a-defect-in-the-first_terms-function-in-the-oeis-module/?answer=24851#post-id-24851