cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A385150 Smallest starting x which reaches the Antihydra halting condition for the first time at 3*n+1 terms of the iteration x -> floor(3*x/2).

This page as a plain text file.
%I A385150 #43 Jun 29 2025 06:27:14
%S A385150 1,6,10,30,24,46,14,16,1284,2398,1844,1326,1048,466,1822,810,5826,856,
%T A385150 254,2820,42658,1880,21442,1396,414,354130,73370,311112,87492,72154,
%U A385150 195408,130272,230286,227214,1668076,927548,2422042,311516,4138178,1243802
%N A385150 Smallest starting x which reaches the Antihydra halting condition for the first time at 3*n+1 terms of the iteration x -> floor(3*x/2).
%C A385150 The terms in the iteration include the starting x itself.
%C A385150 The Antihydra halting condition is that the number of odd terms in the iteration exceeds twice the number of even terms.
%C A385150 This condition is met for the first time in an iteration when the number of odds = 2*evens + 1, which has a total of evens + odds == 1 (mod 3) and hence some 3*n+1 terms.
%C A385150 All odd x halt at 1 term (odds=1, evens=0), so a(n) is even for n >= 1.
%C A385150 a(n) always exists since the least significant 3*n+1 bits of x are in one to one correspondence with the parity pattern of the first 3*n+1 terms in its iteration, and there are A001764(n) parity patterns which halt at 3*n+1.
%C A385150 The Antihydra halting condition only ever activates for ~61.8% of all numbers (the golden ratio minus 1).
%C A385150 But the ultimate fate of various particular starting x values is unknown. For example x=2 doesn't halt in at least 1.5 million steps, and if it ever halts, it is certainly the smallest starting x at that point.
%H A385150 Kevin Ryde, <a href="/A385150/b385150.txt">Table of n, a(n) for n = 0..100</a>
%H A385150 Busy Beaver Wiki, <a href="https://wiki.bbchallenge.org/wiki/Hydra_function">Hydra function</a>
%H A385150 Busy Beaver Wiki, <a href="https://wiki.bbchallenge.org/wiki/Antihydra">Antihydra</a>
%H A385150 Kevin Ryde, <a href="/A385150/a385150.c.txt">C Code</a>
%e A385150 For n=2, a(2) = 10 since x=10 iterates
%e A385150    10 -> 15 -> 22 -> 33 -> 49 -> 73 -> 109
%e A385150     E     O     E     O     O     O      O   parity
%e A385150 and it has first reached number of odds and evens satisfying odds = 2*evens + 1 at 3*n+1 = 7 terms (odds=5, evens=2). 10 is the smallest such number, so a(2) = 10.
%e A385150 Notice that a(2) != 5 because although its iteration 5, 7, 10, 15, 22, 33, 49 also has odds=5 and evens=2, this isn't its first point where it had odds = 2*evens + 1 (but rather back at just 1 term odds=1, evens=0).
%o A385150 (Python)
%o A385150 def a(n):
%o A385150     def calc_halting_steps(num, max_steps):
%o A385150         b = 0
%o A385150         for step in range(1, max_steps + 1):
%o A385150             if num % 2 == 0:
%o A385150                 b += 2
%o A385150             else:
%o A385150                 b -= 1
%o A385150             num = (3 * num) // 2
%o A385150             if b < 0:
%o A385150                 return step
%o A385150         return -1
%o A385150     a_curr = 0
%o A385150     while True:
%o A385150         halting_steps = calc_halting_steps(a_curr, 3 * n + 1)
%o A385150         if halting_steps == 3 * n + 1:
%o A385150             return a_curr
%o A385150         a_curr += 1
%o A385150 (C) /* See links. */
%Y A385150 Cf. A032766 (hydra step), A001764.
%K A385150 nonn
%O A385150 0,2
%A A385150 _Roman Khrabrov_, Jun 19 2025