OFFSET
0,2
COMMENTS
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).
This is a so-called "Collatz-like" function, because A353313 and A353314 have some similarity to the Collatz function A006370.
The sequence can be implemented with a Turing machine with 4 states and 2 colors.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..19683
Nick Drozd, A Busy Beaver Champion Derived from Scratch.
Shawn Ligocki, Collatz-like behavior of Busy Beavers.
Pascal Michel, Busy Beaver competition and Collatz-like problems, Arch. Math. Logic (1993), 32:351-367.
FORMULA
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
EXAMPLE
a(1) = a(3*0 + 1) = a(5*0 + 1 + 3) = a(4)
a(4) = a(3*1 + 1) = a(5*1 + 1 + 3) = a(9)
a(9) = 9
Trajectory of a(1): 4, 9
a(7) = a(3*2 + 1) = a(5*2 + 1 + 3) = a(14)
a(14) = a(3*4 + 2) = a(5*4 + 2 + 3) = a(25)
a(25) = a(3*8 + 1) = a(5*8 + 1 + 3) = a(44)
a(44) = a(3*14 + 2) = a(5*14 + 2 + 3) = a(75)
a(75) = 75
Trajectory of a(7): 14, 25, 44, 75
Trajectory of a(2): 5, 10, 19, 34, 59, 100, 169, 284, 475, 794, 1325, 2210, 3685, 6144.
MATHEMATICA
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 *)
PROG
(Python)
def a(n):
while True:
quot, rem = divmod(n, 3)
if rem == 0:
return n
n = (5 * quot) + rem + 3
(PARI) a(n) = my(d=divrem(n, 3)); if (d[2], a(5*d[1]+d[2]+3), n); \\ Michel Marcus, Dec 05 2021
CROSSREFS
KEYWORD
AUTHOR
Nicholas Drozd, Dec 03 2021
EXTENSIONS
Formal escape clause added to the definition by Antti Karttunen, Apr 14 2022
STATUS
approved