<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bbchallenge.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cirosantilli</id>
	<title>BusyBeaverWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bbchallenge.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cirosantilli"/>
	<link rel="alternate" type="text/html" href="https://wiki.bbchallenge.org/wiki/Special:Contributions/Cirosantilli"/>
	<updated>2026-04-30T21:48:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.bbchallenge.org/w/index.php?title=Antihydra&amp;diff=391</id>
		<title>Antihydra</title>
		<link rel="alternate" type="text/html" href="https://wiki.bbchallenge.org/w/index.php?title=Antihydra&amp;diff=391"/>
		<updated>2024-07-11T08:55:06Z</updated>

		<summary type="html">&lt;p&gt;Cirosantilli: fix code oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Antihydra is the 6-state 2-symbol machine [https://bbchallenge.org/1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA https://bbchallenge.org/1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA].&lt;br /&gt;
&lt;br /&gt;
This machine was the first identified [[BB(6)]] Collatz-like [[Cryptid]], and is closely related to [[Hydra]].&lt;br /&gt;
&lt;br /&gt;
It simulates the Collatz-like iteration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\begin{array}{l}&lt;br /&gt;
  A(2a,   &amp;amp; b) &amp;amp; \to &amp;amp; A(3a,   &amp;amp; b+2) \\&lt;br /&gt;
  A(2a+1, &amp;amp; b) &amp;amp; \to &amp;amp; A(3a+1, &amp;amp; b-1) &amp;amp; \text{if} &amp;amp; b&amp;gt;0 \\&lt;br /&gt;
  A(2a+1, &amp;amp; 0) &amp;amp; \to &amp;amp; \text{HALT}&lt;br /&gt;
\end{array}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
starting from A(8, 0),&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
using configurations of the form &amp;lt;math&amp;gt;A(a+4, b) = 0^\infty \; 1^b \; 0 \; 1^a \; E&amp;gt; \; 0^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was discovered by mxdys on 28 Jun 2024 and shared on Discord [https://discord.com/channels/960643023006490684/1026577255754903572/1256223215206924318].&lt;br /&gt;
&lt;br /&gt;
Racheline found that compared to the [[Hydra]] iteration, this one starts at (8, 0) rather than (3, 0), and the roles of odd and even a are exchanged (in terms of which increases b by two, and which decrements b or halts).&lt;br /&gt;
Obstacles to proving the long-run behavior are equally serious.&lt;br /&gt;
Like the [[Hydra]] iteration, this one is biased toward increasing the value of b (assuming equal chances of adding +2 or -1).&lt;br /&gt;
&lt;br /&gt;
There is no halt in the first 11.8 million iterations, by which point b has reached 5890334 (which means that it also does not halt in the first 17690334 iterations) [https://discord.com/channels/960643023006490684/1026577255754903572/1256403772998029372].&lt;br /&gt;
&lt;br /&gt;
Here is a GMP implementation of the program with some performance diagnostics added:&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* Tested on GMP 6.3.0, Ubuntu 24.04. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;inttypes.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;gmp.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
static uint64_t get_milis(void) {&lt;br /&gt;
    struct timespec ts;&lt;br /&gt;
    timespec_get(&amp;amp;ts, TIME_UTC);&lt;br /&gt;
    return (uint64_t)(ts.tv_sec * 1000 + ts.tv_nsec/1000000);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char **argv) {&lt;br /&gt;
    char *as, *bs;&lt;br /&gt;
    mpz_t a, aq, ar, b;&lt;br /&gt;
    uint64_t i, time, newtime;&lt;br /&gt;
&lt;br /&gt;
    /* CLI and init. */&lt;br /&gt;
    if (argc &amp;gt; 1) {&lt;br /&gt;
        as = argv[1];&lt;br /&gt;
    } else {&lt;br /&gt;
        as = &amp;quot;8&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    if (argc &amp;gt; 2) {&lt;br /&gt;
        bs = argv[2];&lt;br /&gt;
    } else {&lt;br /&gt;
        bs = &amp;quot;0&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    mpz_init_set_str(a, as, 10);&lt;br /&gt;
    mpz_init_set_str(b, bs, 10);&lt;br /&gt;
    mpz_init(aq);&lt;br /&gt;
    mpz_init(ar);&lt;br /&gt;
    i = 0;&lt;br /&gt;
    time = get_milis();&lt;br /&gt;
&lt;br /&gt;
    /* Run. */&lt;br /&gt;
    while (1) {&lt;br /&gt;
        /* aq = a / 2&lt;br /&gt;
         * ar = a % 2 */&lt;br /&gt;
        mpz_fdiv_qr_ui(aq, ar, a, 2);&lt;br /&gt;
        if (&lt;br /&gt;
            /* odd */&lt;br /&gt;
            mpz_cmp_ui(ar, 0)&lt;br /&gt;
        ) {&lt;br /&gt;
            if (!mpz_cmp_ui(b, 0)) break;&lt;br /&gt;
            /* a = aq * 3 + 1 */&lt;br /&gt;
            mpz_mul_ui(a, aq, 3);&lt;br /&gt;
            mpz_add_ui(a, a, 1);&lt;br /&gt;
            /* b -= 1 */&lt;br /&gt;
            mpz_sub_ui(b, b, 1);&lt;br /&gt;
        } else {&lt;br /&gt;
            /* a = aq * 3 */&lt;br /&gt;
            mpz_mul_ui(a, aq, 3);&lt;br /&gt;
            /* b += 2 */&lt;br /&gt;
            mpz_add_ui(b, b, 2);&lt;br /&gt;
        }&lt;br /&gt;
        i++;&lt;br /&gt;
        if (i % 100000 == 0) {&lt;br /&gt;
            newtime = get_milis();&lt;br /&gt;
            gmp_printf(&amp;quot;%&amp;quot; PRIu64 &amp;quot; ms=%&amp;quot; PRIu64 &amp;quot; log10(a)=%ju log10(b)=%ju\n&amp;quot;,&lt;br /&gt;
                       i/100000, newtime - time, mpz_sizeinbase(a, 10), mpz_sizeinbase(b, 10));&lt;br /&gt;
            time = newtime;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Cleanup if we ever reach it. */&lt;br /&gt;
    mpz_clear(a);&lt;br /&gt;
    mpz_clear(aq);&lt;br /&gt;
    mpz_clear(ar);&lt;br /&gt;
    mpz_clear(b);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
‎&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile and run with:&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -ggdb3 -O2 -pedantic-errors -std=c11 -Wall -Wextra -o &#039;antihydra.out&#039; &#039;antihydra.c&#039; -lgmp&lt;br /&gt;
./antihydra.out&lt;br /&gt;
‎&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tested on Tested on GMP 6.3.0, Ubuntu 24.04.&lt;br /&gt;
[[Category:Individual machines]]&lt;/div&gt;</summary>
		<author><name>Cirosantilli</name></author>
	</entry>
	<entry>
		<id>https://wiki.bbchallenge.org/w/index.php?title=Antihydra&amp;diff=352</id>
		<title>Antihydra</title>
		<link rel="alternate" type="text/html" href="https://wiki.bbchallenge.org/w/index.php?title=Antihydra&amp;diff=352"/>
		<updated>2024-07-10T10:14:16Z</updated>

		<summary type="html">&lt;p&gt;Cirosantilli: Add GMP implementation of the problem.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Antihydra is the 6-state 2-symbol machine [https://bbchallenge.org/1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA https://bbchallenge.org/1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA].&lt;br /&gt;
&lt;br /&gt;
This machine was the first identified [[BB(6)]] Collatz-like [[Cryptid]], and is closely related to [[Hydra]].&lt;br /&gt;
&lt;br /&gt;
It simulates the Collatz-like iteration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\begin{array}{l}&lt;br /&gt;
  A(2a,   &amp;amp; b) &amp;amp; \to &amp;amp; A(3a,   &amp;amp; b+2) \\&lt;br /&gt;
  A(2a+1, &amp;amp; b) &amp;amp; \to &amp;amp; A(3a+1, &amp;amp; b-1) &amp;amp; \text{if} &amp;amp; b&amp;gt;0 \\&lt;br /&gt;
  A(2a+1, &amp;amp; 0) &amp;amp; \to &amp;amp; \text{HALT}&lt;br /&gt;
\end{array}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
starting from A(8, 0),&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
using configurations of the form &amp;lt;math&amp;gt;A(a+4, b) = 0^\infty \; 1^b \; 0 \; 1^a \; E&amp;gt; \; 0^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was discovered by mxdys on 28 Jun 2024 and shared on Discord [https://discord.com/channels/960643023006490684/1026577255754903572/1256223215206924318].&lt;br /&gt;
&lt;br /&gt;
Racheline found that compared to the [[Hydra]] iteration, this one starts at (8, 0) rather than (3, 0), and the roles of odd and even a are exchanged (in terms of which increases b by two, and which decrements b or halts).&lt;br /&gt;
Obstacles to proving the long-run behavior are equally serious.&lt;br /&gt;
Like the [[Hydra]] iteration, this one is biased toward increasing the value of b (assuming equal chances of adding +2 or -1).&lt;br /&gt;
&lt;br /&gt;
There is no halt in the first 11.8 million iterations, by which point b has reached 5890334 (which means that it also does not halt in the first 17690334 iterations) [https://discord.com/channels/960643023006490684/1026577255754903572/1256403772998029372].&lt;br /&gt;
&lt;br /&gt;
Here is a GMP implementation of the program with some performance diagnostics added:&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;inttypes.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;gmp.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
static uint64_t get_milis(void) {&lt;br /&gt;
    struct timespec ts;&lt;br /&gt;
    timespec_get(&amp;amp;ts, TIME_UTC);&lt;br /&gt;
    return (uint64_t)(ts.tv_sec * 1000 + ts.tv_nsec/1000000);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char **argv) {&lt;br /&gt;
    char *as, *bs;&lt;br /&gt;
    mpz_t a, aq, ar, b;&lt;br /&gt;
    uint64_t i, time, newtime;&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;gt; 1) {&lt;br /&gt;
        as = argv[1];&lt;br /&gt;
    } else {&lt;br /&gt;
        as = &amp;quot;8&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    if (argc &amp;gt; 2) {&lt;br /&gt;
        bs = argv[2];&lt;br /&gt;
    } else {&lt;br /&gt;
        bs = &amp;quot;0&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    mpz_init_set_str(a, as, 10);&lt;br /&gt;
    mpz_init_set_str(b, bs, 10);&lt;br /&gt;
    mpz_init(aq);&lt;br /&gt;
    mpz_init(ar);&lt;br /&gt;
&lt;br /&gt;
    i = 0;&lt;br /&gt;
    time = get_milis();&lt;br /&gt;
    while (1) {&lt;br /&gt;
        mpz_fdiv_qr_ui(aq, ar, a, 2);&lt;br /&gt;
        if (!mpz_cmp_ui(ar, 0)) {&lt;br /&gt;
            mpz_mul_ui(a, aq, 3);&lt;br /&gt;
            mpz_add_ui(b, b, 2);&lt;br /&gt;
        } else {&lt;br /&gt;
            if (!mpz_cmp_ui(ar, 0)) break;&lt;br /&gt;
            mpz_mul_ui(a, aq, 3);&lt;br /&gt;
            mpz_add_ui(a, a, 1);&lt;br /&gt;
            mpz_sub_ui(b, b, 1);&lt;br /&gt;
        }&lt;br /&gt;
        i++;&lt;br /&gt;
        if (i % 100000 == 0) {&lt;br /&gt;
            newtime = get_milis();&lt;br /&gt;
            gmp_printf(&amp;quot;%&amp;quot; PRIu64 &amp;quot; ms=%&amp;quot; PRIu64 &amp;quot; log10(a)=%ju log10(b)=%ju\n&amp;quot;,&lt;br /&gt;
                       i/100000, newtime - time, mpz_sizeinbase(a, 10), mpz_sizeinbase(b, 10));&lt;br /&gt;
            time = newtime;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    mpz_clear(a);&lt;br /&gt;
    mpz_clear(aq);&lt;br /&gt;
    mpz_clear(ar);&lt;br /&gt;
    mpz_clear(b);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
‎&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile and run with:&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -ggdb3 -O2 -pedantic-errors -std=c11 -Wall -Wextra -o &#039;antihydra.out&#039; &#039;antihydra.c&#039; -lgmp&lt;br /&gt;
./antihydra.out&lt;br /&gt;
‎&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tested on Tested on GMP 6.3.0, Ubuntu 24.04.&lt;br /&gt;
[[Category:Individual machines]]&lt;/div&gt;</summary>
		<author><name>Cirosantilli</name></author>
	</entry>
</feed>