<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://teherba.org/tehowiki/index.php?action=history&amp;feed=atom&amp;title=OEIS%2FNegative-Positive</id>
	<title>OEIS/Negative-Positive - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://teherba.org/tehowiki/index.php?action=history&amp;feed=atom&amp;title=OEIS%2FNegative-Positive"/>
	<link rel="alternate" type="text/html" href="http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;action=history"/>
	<updated>2026-05-25T08:45:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;diff=394&amp;oldid=prev</id>
		<title>imported&gt;Gfis: Results at the end</title>
		<link rel="alternate" type="text/html" href="http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;diff=394&amp;oldid=prev"/>
		<updated>2018-03-26T16:42:08Z</updated>

		<summary type="html">&lt;p&gt;Results at the end&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:42, 26 March 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l246&quot;&gt;Line 246:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 246:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* to regenerate the particular sequences and  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* to regenerate the particular sequences and  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* to compare them against the stored b-files.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* to compare them against the stored b-files.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Results==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The trailing terms of the 2 inverse sequences [https://oeis.org/A131390 A131390] and [https://oeis.org/A131395 A131395] were found to be wrong, maybe because too few terms of the normal sequence were used. For [https://oeis.org/A131393 A131393] and its dependants, more terms up to 1000 were computed. All other b-files showed no differences. No differences were found either during a manual check of about 1/3 of the Mathematica programs.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l529&quot;&gt;Line 529:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 527:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Results==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The trailing terms of the 2 inverse sequences [https://oeis.org/A131390 A131390] and [https://oeis.org/A131395 A131395] were found to be wrong, maybe because too few terms of the normal sequence were used. For [https://oeis.org/A131393 A131393] and its dependants, more terms up to 1000 were computed. All other b-files showed no differences. No differences were found either during a manual check of about 1/3 of the Mathematica programs.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Gfis</name></author>
	</entry>
	<entry>
		<id>http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;diff=393&amp;oldid=prev</id>
		<title>imported&gt;Gfis: github</title>
		<link rel="alternate" type="text/html" href="http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;diff=393&amp;oldid=prev"/>
		<updated>2018-03-26T15:06:23Z</updated>

		<summary type="html">&lt;p&gt;github&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:06, 26 March 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[https://oeis.org/wiki/User:Clark_Kimberling Clark Kimberling] defined - for example - [https://OEIS.org/A131388 A131388] with the following &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rules&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[https://oeis.org/wiki/User:Clark_Kimberling Clark Kimberling] defined - for example - [https://OEIS.org/A131388 A131388] with the following &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rule&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  Rule 1 follows.  For k &amp;gt;= 1, let  A(k) = {a(1), …, a(k)} and D(k) = {d(1), …, d(k)}.  Begin with k = 1 and nonnegative integers a(1) and d(1).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  Rule 1 follows.  For k &amp;gt;= 1, let  A(k) = {a(1), …, a(k)} and D(k) = {d(1), …, d(k)}.  Begin with k = 1 and nonnegative integers a(1) and d(1).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  Step 1:   If there is an integer h such that 1 - a(k) &amp;lt; h &amp;lt; 0 and h is not in D(k) and a(k) + h is not in A(k), let d(k+1) be the greatest such h, let a(k+1) = a(k) + h, replace k by k + 1, and repeat Step 1; otherwise do Step 2.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  Step 1:   If there is an integer h such that 1 - a(k) &amp;lt; h &amp;lt; 0 and h is not in D(k) and a(k) + h is not in A(k), let d(k+1) be the greatest such h, let a(k+1) = a(k) + h, replace k by k + 1, and repeat Step 1; otherwise do Step 2.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l69&quot;&gt;Line 69:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 69:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  [https://oeis.org/A258047 A258047] Rule 3.1 d  1 0&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  [https://oeis.org/A258047 A258047] Rule 3.1 d  1 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Generating Perl program==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Generating Perl program==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The Perl program below can be used to generate all sequences of the list. It produces b-files with up to 100,000 terms rather rather quickly. The program takes parameters as described in the header. It contains the lost code portion of Rule 2 mentioned in the comment for [https://oeis.org/A131393 A131393], and it implements the different variants depending on the parameter &amp;lt;code&amp;gt;$op&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/del&gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The Perl program below can be used to generate all sequences of the list. It produces b-files with up to 100,000 terms rather rather quickly. The program takes parameters as described in the header. It contains the lost code portion of Rule 2 mentioned in the comment for [https://oeis.org/A131393 A131393], and it implements the different variants depending on the parameter &amp;lt;code&amp;gt;$op&amp;lt;/code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. The latest version of the program and its auxilliary files can be found on a [https://github.com/gfis/fasces/tree/master/oeis/negpos Github repository].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Gfis</name></author>
	</entry>
	<entry>
		<id>http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;diff=392&amp;oldid=prev</id>
		<title>imported&gt;Gfis: results</title>
		<link rel="alternate" type="text/html" href="http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;diff=392&amp;oldid=prev"/>
		<updated>2018-03-26T14:59:18Z</updated>

		<summary type="html">&lt;p&gt;results&lt;/p&gt;
&lt;a href=&quot;http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;amp;diff=392&amp;amp;oldid=391&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>imported&gt;Gfis</name></author>
	</entry>
	<entry>
		<id>http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;diff=391&amp;oldid=prev</id>
		<title>imported&gt;Gfis: up to .pl</title>
		<link rel="alternate" type="text/html" href="http://teherba.org/tehowiki/index.php?title=OEIS/Negative-Positive&amp;diff=391&amp;oldid=prev"/>
		<updated>2018-03-26T12:37:16Z</updated>

		<summary type="html">&lt;p&gt;up to .pl&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[https://oeis.org/wiki/User:Clark_Kimberling Clark Kimberling] defined - for example - [https://OEIS.org/A131388 A131388] with the following rules:&lt;br /&gt;
 Rule 1 follows.  For k &amp;gt;= 1, let  A(k) = {a(1), …, a(k)} and D(k) = {d(1), …, d(k)}.  Begin with k = 1 and nonnegative integers a(1) and d(1).&lt;br /&gt;
 Step 1:   If there is an integer h such that 1 - a(k) &amp;lt; h &amp;lt; 0 and h is not in D(k) and a(k) + h is not in A(k), let d(k+1) be the greatest such h, let a(k+1) = a(k) + h, replace k by k + 1, and repeat Step 1; otherwise do Step 2.&lt;br /&gt;
 Step 2:  Let h be the least positive integer not in D(k) such that a(k) + h is not in A(k).  Let a(k+1) = a(k) + h and d(k+1) = h.  Replace k by k+1 and do Step 1.&lt;br /&gt;
 Conjecture:  if a(1) is an nonnegative integer and d(1) is an integer, then (a(n)) is a permutation of the nonnegative integers (if a(1) = 0) or a permutation of the positive integers (if a(1) &amp;gt; 0).  Moreover, (d(n)) is a permutation of the integers if d(1) = 0, or of the nonzero integers if d(1) &amp;gt; 0.&lt;br /&gt;
&lt;br /&gt;
Depending on the starting values a(1) and d(1), and with variations of the rules, there are several dozens of related sequences in the OEIS. [https://oeis.org/A257705 A257705] lists 15 of them. &lt;br /&gt;
&lt;br /&gt;
==List of Negative-Positive sequences==&lt;br /&gt;
The list below gives a more extended overview. The list has the following entries:&lt;br /&gt;
* the OEIS A-number,&lt;br /&gt;
* the major rule number as defined by C. Kimberling, except for &amp;quot;Rule 4&amp;quot; which he calls the &amp;quot;Algorithm&amp;quot;,&lt;br /&gt;
* the minor rule number which gives the first constant (s = 0, 1) in Step 1 above: &amp;quot;... such that s - a(k) &amp;lt; h &amp;lt; 0 ...&amp;quot;,&lt;br /&gt;
* a letter code for the type of the sequence: &lt;br /&gt;
** &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; for a(k),&lt;br /&gt;
** &amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt; for d(k),&lt;br /&gt;
** &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; for inverse(a(k)),&lt;br /&gt;
** &amp;lt;code&amp;gt;cp&amp;lt;/code&amp;gt; for positions of positive integers,&lt;br /&gt;
** &amp;lt;code&amp;gt;cn&amp;lt;/code&amp;gt; for positions of negative integers,&lt;br /&gt;
** &amp;lt;code&amp;gt;d0&amp;lt;/code&amp;gt; for positions of non-negative terms,&lt;br /&gt;
** &amp;lt;code&amp;gt;dn&amp;lt;/code&amp;gt; for positions of negative terms,&lt;br /&gt;
* the starting values a(1) and d(1).&lt;br /&gt;
 [https://oeis.org/A131388 A131388] Rule 1.1 a  1 0&lt;br /&gt;
 [https://oeis.org/A131389 A131389] Rule 1.1 d  1 0&lt;br /&gt;
 [https://oeis.org/A131390 A131390] Rule 1.1 in 1 0&lt;br /&gt;
 [https://oeis.org/A131391 A131391] Rule 1.1 cp 1 0&lt;br /&gt;
 [https://oeis.org/A131392 A131392] Rule 1.1 cn 1 0&lt;br /&gt;
 [https://oeis.org/A131393 A131393] Rule 2.1 a  1 0&lt;br /&gt;
 [https://oeis.org/A131394 A131394] Rule 2.1 d  1 0&lt;br /&gt;
 [https://oeis.org/A131395 A131395] Rule 2.1 in 1 0&lt;br /&gt;
 [https://oeis.org/A131396 A131396] Rule 2.1 cp 1 0&lt;br /&gt;
 [https://oeis.org/A131397 A131397] Rule 2.1 cn 1 0&lt;br /&gt;
 [https://oeis.org/A175007 A175007] Rule 1.1 d0 1 0&lt;br /&gt;
 [https://oeis.org/A175008 A175008] Rule 1.1 dn 1 0&lt;br /&gt;
 [https://oeis.org/A175498 A175498] Rule 4.0 a  1 0&lt;br /&gt;
 [https://oeis.org/A175499 A175499] Rule 4.0 d  0 1&lt;br /&gt;
 [https://oeis.org/A257705 A257705] Rule 1.1 a  0 0&lt;br /&gt;
 [https://oeis.org/A257706 A257706] Rule 1.0 a  0 1&lt;br /&gt;
 [https://oeis.org/A257876 A257876] Rule 1.1 a  0 2&lt;br /&gt;
 [https://oeis.org/A257877 A257877] Rule 1.1 a  0 3&lt;br /&gt;
 [https://oeis.org/A257878 A257878] Rule 1.1 a  1 1&lt;br /&gt;
 [https://oeis.org/A257879 A257879] Rule 1.0 a  2 0&lt;br /&gt;
 [https://oeis.org/A257880 A257880] Rule 1.0 d  2 0&lt;br /&gt;
 [https://oeis.org/A257881 A257881] Rule 1.0 a  2 1&lt;br /&gt;
 [https://oeis.org/A257882 A257882] Rule 1.0 a  2 2&lt;br /&gt;
 [https://oeis.org/A257883 A257883] Rule 4.0 a  0 0&lt;br /&gt;
 [https://oeis.org/A257884 A257884] Rule 4.0 a  0 1&lt;br /&gt;
 [https://oeis.org/A257885 A257885] Rule 4.0 a  0 2&lt;br /&gt;
 [https://oeis.org/A257902 A257902] Rule 4.0 d  0 2&lt;br /&gt;
 [https://oeis.org/A257903 A257903] Rule 4.0 a  0 3&lt;br /&gt;
 [https://oeis.org/A257904 A257904] Rule 4.0 d  0 3&lt;br /&gt;
 [https://oeis.org/A257905 A257905] Rule 3.1 a  0 0&lt;br /&gt;
 [https://oeis.org/A257906 A257906] Rule 3.1 a  0 1&lt;br /&gt;
 [https://oeis.org/A257907 A257907] Rule 3.1 d  0 1&lt;br /&gt;
 [https://oeis.org/A257908 A257908] Rule 3.0 a  0 2&lt;br /&gt;
 [https://oeis.org/A257909 A257909] Rule 3.0 d  0 2&lt;br /&gt;
 [https://oeis.org/A257910 A257910] Rule 3.0 a  0 3&lt;br /&gt;
 [https://oeis.org/A257911 A257911] Rule 4.0 a  2 2&lt;br /&gt;
 [https://oeis.org/A257912 A257912] Rule 4.0 d  2 2&lt;br /&gt;
 [https://oeis.org/A257915 A257915] Rule 1.1 d  0 3&lt;br /&gt;
 [https://oeis.org/A257918 A257918] Rule 1.0 d  2 2&lt;br /&gt;
 [https://oeis.org/A257980 A257980] Rule 3.1 d  0 3&lt;br /&gt;
 [https://oeis.org/A257981 A257981] Rule 3.1 a  1 1&lt;br /&gt;
 [https://oeis.org/A257982 A257982] Rule 3.1 d  1 1&lt;br /&gt;
 [https://oeis.org/A257983 A257983] Rule 3.1 a  1 2&lt;br /&gt;
 [https://oeis.org/A257985 A257985] Rule 3.1 a  2 0&lt;br /&gt;
 [https://oeis.org/A257986 A257986] Rule 3.1 a  2 1&lt;br /&gt;
 [https://oeis.org/A257987 A257987] Rule 3.1 a  2 2&lt;br /&gt;
 [https://oeis.org/A258046 A258046] Rule 3.1 a  1 0&lt;br /&gt;
 [https://oeis.org/A258047 A258047] Rule 3.1 d  1 0&lt;br /&gt;
==Generating Perl program==&lt;br /&gt;
All the sequences in the list above can be generated quickly up to 100,000 terms with the following Perl program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!perl&lt;br /&gt;
&lt;br /&gt;
# Generate OEIS Sequence A131393 and its companions&lt;br /&gt;
# as defined by Clark Kimberling&lt;br /&gt;
# @(#) $Id$&lt;br /&gt;
# 2018-02-24, Georg Fischer&lt;br /&gt;
#------------------------------------------------------&lt;br /&gt;
# C.f. list of sequences in https://oeis.org/search?q=A257705&lt;br /&gt;
# usage:&lt;br /&gt;
#   perl negpos.pl rule s noeis n op a1 d1&lt;br /&gt;
#       rule  = 1|2|3|4&lt;br /&gt;
#       s     = 0|1&lt;br /&gt;
#       noeis = &amp;quot;131388|131389|131393|131394...&amp;quot; (without &amp;quot;A&amp;quot;)&lt;br /&gt;
#       n     = length of sequence to be generated&lt;br /&gt;
#       op    = ak, dk, cp, cn, dp(positive d(K)), dn(negative d(k)), in(inverse) &lt;br /&gt;
#       a1    = starting value for a(1)&lt;br /&gt;
#       d1    = starting value for d(1)&lt;br /&gt;
#------------------------------------------------------&lt;br /&gt;
# Formula (Rule 1):&lt;br /&gt;
# a(k) = a(k-1) + d(k) &lt;br /&gt;
# d(k) = max({s, s-1 ... 1-a(k-1)}) such that&lt;br /&gt;
#   d(k) not in d(1..k-1) and&lt;br /&gt;
#   a(k) not in a(1..k-1)&lt;br /&gt;
# if no such d(k) exists, then&lt;br /&gt;
# d(k) = min({1,2, ... a(k-1)}) such that&lt;br /&gt;
#   d(k) not in d(1..k-1) and&lt;br /&gt;
#   a(k) not in a(1..k-1)&lt;br /&gt;
# s = -1 for A131388, and s = min(-1, d(k-1)) for A131393&lt;br /&gt;
#--------------------------------------------------------&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
my $rule = 1;   if (scalar(@ARGV) &amp;gt; 0) { $rule  = shift(@ARGV); }&lt;br /&gt;
my $s = 1;      if (scalar(@ARGV) &amp;gt; 0) { $s     = shift(@ARGV); }&lt;br /&gt;
my $noeis = &amp;quot;&amp;quot;; if (scalar(@ARGV) &amp;gt; 0) { $noeis = shift(@ARGV); }&lt;br /&gt;
my $n = 1000;   if (scalar(@ARGV) &amp;gt; 0) { $n     = shift(@ARGV); }&lt;br /&gt;
my $op = &amp;quot;ak&amp;quot;;  if (scalar(@ARGV) &amp;gt; 0) { $op    = shift(@ARGV); }&lt;br /&gt;
my $a1 = 1;     if (scalar(@ARGV) &amp;gt; 0) { $a1    = shift(@ARGV); }&lt;br /&gt;
my $d1 = 0;     if (scalar(@ARGV) &amp;gt; 0) { $d1    = shift(@ARGV); }&lt;br /&gt;
my $k = 1;&lt;br /&gt;
my $ak = $a1; my $akm1 = $ak; my %aset = ($ak, $k);&lt;br /&gt;
my $dk = $d1; my $dkm1 = $dk; my %dset = ($dk, $k); # $dk is h&lt;br /&gt;
print &amp;quot;# http://oeis.org/A$noeis/b$noeis.txt:&amp;quot;&lt;br /&gt;
        . &amp;quot; table n,a(n),n=1..$n\n&amp;quot;;&lt;br /&gt;
#    print &amp;quot;# ak = $ak, dk = $dk, akm1 = $akm1, dkm1 = $dkm1 \n&amp;quot;;&lt;br /&gt;
    if (0) {&lt;br /&gt;
    } elsif ($op eq &amp;quot;ak&amp;quot;) {&lt;br /&gt;
        print &amp;quot;$k $ak\n&amp;quot;;&lt;br /&gt;
    } elsif ($op eq &amp;quot;dk&amp;quot;) {&lt;br /&gt;
        print &amp;quot;$k $dk\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
my $busy;&lt;br /&gt;
$k ++;&lt;br /&gt;
while ($k &amp;lt;= $n) {&lt;br /&gt;
    $busy = 1;&lt;br /&gt;
    if (0) {&lt;br /&gt;
    } elsif ($rule == 1 or $rule == 2) { # for A131388, A257705 et al.&lt;br /&gt;
        $dk = -1; # start downwards&lt;br /&gt;
        if ($rule == 2 and $dkm1 &amp;lt; 0) { # for A131393 et al.&lt;br /&gt;
            $dk = $dkm1 - 1;&lt;br /&gt;
        }&lt;br /&gt;
        while ($busy == 1 and $dk &amp;gt; $s - $akm1) { # downwards&lt;br /&gt;
            $ak = $akm1 + $dk;&lt;br /&gt;
            if (!defined($aset{$ak}) and !defined($dset{$dk} and $ak&amp;gt;0)) {&lt;br /&gt;
                $busy=0; $aset{$ak} = $k;         $dset{$dk}=$k;&lt;br /&gt;
            } else {&lt;br /&gt;
                $dk --;&lt;br /&gt;
            }&lt;br /&gt;
        } # while downwards&lt;br /&gt;
        if ($busy == 1) {&lt;br /&gt;
            $dk = +1; # start upwards&lt;br /&gt;
        }&lt;br /&gt;
        while ($busy == 1                     ) { # upwards&lt;br /&gt;
            $ak = $akm1 + $dk;&lt;br /&gt;
            if (!defined($aset{$ak}) and !defined($dset{$dk}          )) {&lt;br /&gt;
                $busy=0; $aset{$ak} = $k;         $dset{$dk}=$k;&lt;br /&gt;
            } else {&lt;br /&gt;
                $dk ++;&lt;br /&gt;
            }&lt;br /&gt;
        } # while upwards&lt;br /&gt;
&lt;br /&gt;
    } elsif ($rule == 3) { # for A257905, 908&lt;br /&gt;
    	# print &amp;quot;$k $akm1 dk=$dkm1\n&amp;quot;;&lt;br /&gt;
        $dk = $s - $akm1 + 1; # start upwards in negative&lt;br /&gt;
        while ($busy == 1 and $dk &amp;lt; 0) { &lt;br /&gt;
            $ak = $akm1 + $dk;&lt;br /&gt;
            if (!defined($aset{$ak}) and !defined($dset{$dk} and $ak&amp;gt;0)) {&lt;br /&gt;
                $busy=0; $aset{$ak} = $k;         $dset{$dk}=$k;&lt;br /&gt;
            } else {&lt;br /&gt;
                $dk ++;&lt;br /&gt;
            }&lt;br /&gt;
        } # while negative&lt;br /&gt;
        if ($busy == 1) {&lt;br /&gt;
            $dk = +1; # start upwards&lt;br /&gt;
        }&lt;br /&gt;
        while ($busy == 1                     ) { # upwards&lt;br /&gt;
            $ak = $akm1 + $dk;&lt;br /&gt;
            if (!defined($aset{$akm1 - $dk}) and !defined($dset{$dk}          )) {&lt;br /&gt;
                $busy=0; $aset{$ak        } = $k;         $dset{$dk}=$k;&lt;br /&gt;
            } else {&lt;br /&gt;
                $dk ++;&lt;br /&gt;
            }&lt;br /&gt;
        } # while upwards&lt;br /&gt;
&lt;br /&gt;
    } elsif ($rule == 4) { # &amp;quot;Algorithm&amp;quot; for A257883 et al.&lt;br /&gt;
        $dk = $s - $ak + 1;&lt;br /&gt;
        while ($busy == 1                      ) { # upwards&lt;br /&gt;
            $ak = $akm1 + $dk;&lt;br /&gt;
            if (!defined($aset{$ak}) and !defined($dset{$dk} and $ak&amp;gt;0)) {&lt;br /&gt;
                $busy=0; $aset{$ak} = $k;         $dset{$dk}=$k;&lt;br /&gt;
            } else {&lt;br /&gt;
                $dk ++;&lt;br /&gt;
            }&lt;br /&gt;
        } # while upwards&lt;br /&gt;
    }&lt;br /&gt;
    if (0) {&lt;br /&gt;
    } elsif ($op eq &amp;quot;ak&amp;quot;) {&lt;br /&gt;
        print &amp;quot;$k $ak\n&amp;quot;;&lt;br /&gt;
    } elsif ($op eq &amp;quot;dk&amp;quot;) {&lt;br /&gt;
        print &amp;quot;$k $dk\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    # print &amp;quot;\t# ak = $ak, dk = $dk, akm1 = $akm1, dkm1 = $dkm1\n&amp;quot;;&lt;br /&gt;
    $akm1 = $ak; $dkm1 = $dk;&lt;br /&gt;
    $k ++; # iterate&lt;br /&gt;
} # while $k&lt;br /&gt;
#--------&lt;br /&gt;
if ($op !~ m{ak|dk}) { # output of operations other than &amp;quot;ak&amp;quot;, &amp;quot;dk&amp;quot;&lt;br /&gt;
    my @ainv = sort(map { $_ = sprintf(&amp;quot;%06d %d&amp;quot;, $_, $aset{$_}); $_ } keys(%aset));&lt;br /&gt;
    my @dpos = sort(map { $_ = sprintf(&amp;quot;%06d %d&amp;quot;, $dset{$_}, $_); $_ } keys(%dset));&lt;br /&gt;
    # my $temp = shift(@dpos); # accounts for positions &amp;quot;-1&amp;quot;&lt;br /&gt;
    # print join(&amp;quot;\n&amp;quot;, @dpos) . &amp;quot;\n&amp;quot;;&lt;br /&gt;
    if (0) {&lt;br /&gt;
    } elsif ($op =~ m{in}) {&lt;br /&gt;
        $k = 0;&lt;br /&gt;
        $busy = 1;&lt;br /&gt;
        while ($busy == 1 and $k &amp;lt; scalar(@ainv)) {&lt;br /&gt;
            my ($j, $aj) = split(/ /, $ainv[$k]);&lt;br /&gt;
            $j += 0; # removes the leading zeroes&lt;br /&gt;
            $busy = ($j == $k + 1 ? 1 : 0);&lt;br /&gt;
            if ($busy == 1) {&lt;br /&gt;
                print &amp;quot;$j $aj\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            $k ++;&lt;br /&gt;
        } # while $k&lt;br /&gt;
    } elsif ($op =~ m{cp|dp|c0|d0}) {&lt;br /&gt;
        my $k = 0;&lt;br /&gt;
        print join(&amp;quot;&amp;quot;, map { my ($j, $dj) = split(/\s+/); &lt;br /&gt;
                $j = ($op =~ m{\Ac}) ? $j - 1 : $j + 0; &lt;br /&gt;
                $_ = &amp;quot;&amp;quot;;&lt;br /&gt;
                if ($dj &amp;gt; (($op =~ m{0}) ? -1 : 0)) {&lt;br /&gt;
                    $k ++;&lt;br /&gt;
                    $_ = &amp;quot;$k $j\n&amp;quot;;&lt;br /&gt;
                }&lt;br /&gt;
                $_ } @dpos) . &amp;quot;\n&amp;quot;;&lt;br /&gt;
    } elsif ($op =~ m{cn|dn}) {&lt;br /&gt;
        my $k = 0;&lt;br /&gt;
        print join(&amp;quot;&amp;quot;, map { my ($j, $dj) = split(/\s+/); &lt;br /&gt;
                $j = ($op =~ m{\Ac}) ? $j - 1 : $j + 0; &lt;br /&gt;
                $_ = &amp;quot;&amp;quot;;&lt;br /&gt;
                if ($dj &amp;lt; 0) {&lt;br /&gt;
                    $k ++;&lt;br /&gt;
                    $_ = &amp;quot;$k $j\n&amp;quot;;&lt;br /&gt;
                }&lt;br /&gt;
                $_ } @dpos) . &amp;quot;\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
} # other oper&lt;br /&gt;
# https://oeis.org/wiki/User:Georg_Fischer Feb. 24, 2018&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Gfis</name></author>
	</entry>
</feed>