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.
%I A349876 #52 Apr 16 2022 05:34:04 %S A349876 0,9,6144,3,9,6144,6,75,15,9,6144,60,12,24,75,15,144,30,18,6144,60,21, %T A349876 39,69,24,75,45,27,84,144,30,54,159,33,6144,60,36,309,519,39,69,1560, %U A349876 42,210,75,45,225,135,48,84,144,51,150,90,54,159,450,57,99,6144,60,294,105,63 %N A349876 If n is divisible by 3, a(n) = n; otherwise n = 3k + r with r in {1, 2} and a(n) = a(5k + r + 3). a(n) = -1 if no multiple of three will be ever reached by iterating A353314. %C A349876 It is not known if this function is total, that is, if a(n) is well-defined for all n (this is the reason for the escape clause in the definition). %C A349876 This is a so-called "Collatz-like" function, because A353313 and A353314 have some similarity to the Collatz function A006370. %C A349876 The sequence can be implemented with a Turing machine with 4 states and 2 colors. %H A349876 Antti Karttunen, <a href="/A349876/b349876.txt">Table of n, a(n) for n = 0..19683</a> %H A349876 Nick Drozd, <a href="https://nickdrozd.github.io/2021/10/31/busy-beaver-derived.html">A Busy Beaver Champion Derived from Scratch</a>. %H A349876 Shawn Ligocki, <a href="https://www.sligocki.com/2021/07/17/bb-collatz.html">Collatz-like behavior of Busy Beavers</a>. %H A349876 Pascal Michel, <a href="https://doi.org/10.1007/BF01409968">Busy Beaver competition and Collatz-like problems</a>, Arch. Math. Logic (1993), 32:351-367. %F A349876 If A010872(n) = 0 [when n is a multiple of 3], a(n) = n, otherwise a(n) = a(A353314(n)). [Here one may also use A353313 instead of A353314] - _Antti Karttunen_, Apr 14 2022 %e A349876 a(1) = a(3*0 + 1) = a(5*0 + 1 + 3) = a(4) %e A349876 a(4) = a(3*1 + 1) = a(5*1 + 1 + 3) = a(9) %e A349876 a(9) = 9 %e A349876 Trajectory of a(1): 4, 9 %e A349876 a(7) = a(3*2 + 1) = a(5*2 + 1 + 3) = a(14) %e A349876 a(14) = a(3*4 + 2) = a(5*4 + 2 + 3) = a(25) %e A349876 a(25) = a(3*8 + 1) = a(5*8 + 1 + 3) = a(44) %e A349876 a(44) = a(3*14 + 2) = a(5*14 + 2 + 3) = a(75) %e A349876 a(75) = 75 %e A349876 Trajectory of a(7): 14, 25, 44, 75 %e A349876 Trajectory of a(2): 5, 10, 19, 34, 59, 100, 169, 284, 475, 794, 1325, 2210, 3685, 6144. %t A349876 a[n_] := a[n] = Module[{qr = QuotientRemainder[n, 3]}, If[qr[[2]] == 0, n, a[5*qr[[1]] + qr[[2]] + 3]]]; Array[a, 64, 0] (* _Amiram Eldar_, Jan 04 2022 *) %o A349876 (Python) %o A349876 def a(n): %o A349876 while True: %o A349876 quot, rem = divmod(n, 3) %o A349876 if rem == 0: %o A349876 return n %o A349876 n = (5 * quot) + rem + 3 %o A349876 (PARI) a(n) = my(d=divrem(n, 3)); if (d[2], a(5*d[1]+d[2]+3), n); \\ _Michel Marcus_, Dec 05 2021 %Y A349876 Cf. A010872, A349877, A349896 (record values), A353313, A353314. %Y A349876 Cf. also A006370. %K A349876 nonn,easy,look %O A349876 0,2 %A A349876 _Nicholas Drozd_, Dec 03 2021 %E A349876 Formal escape clause added to the definition by _Antti Karttunen_, Apr 14 2022