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).
1, 6, 10, 30, 24, 46, 14, 16, 1284, 2398, 1844, 1326, 1048, 466, 1822, 810, 5826, 856, 254, 2820, 42658, 1880, 21442, 1396, 414, 354130, 73370, 311112, 87492, 72154, 195408, 130272, 230286, 227214, 1668076, 927548, 2422042, 311516, 4138178, 1243802
Offset: 0
Keywords
Examples
For n=2, a(2) = 10 since x=10 iterates 10 -> 15 -> 22 -> 33 -> 49 -> 73 -> 109 E O E O O O O parity 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. 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).
Links
- Kevin Ryde, Table of n, a(n) for n = 0..100
- Busy Beaver Wiki, Hydra function
- Busy Beaver Wiki, Antihydra
- Kevin Ryde, C Code
Programs
-
C
/* See links. */
-
Python
def a(n): def calc_halting_steps(num, max_steps): b = 0 for step in range(1, max_steps + 1): if num % 2 == 0: b += 2 else: b -= 1 num = (3 * num) // 2 if b < 0: return step return -1 a_curr = 0 while True: halting_steps = calc_halting_steps(a_curr, 3 * n + 1) if halting_steps == 3 * n + 1: return a_curr a_curr += 1
Comments