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.

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.

Original entry on oeis.org

0, 9, 6144, 3, 9, 6144, 6, 75, 15, 9, 6144, 60, 12, 24, 75, 15, 144, 30, 18, 6144, 60, 21, 39, 69, 24, 75, 45, 27, 84, 144, 30, 54, 159, 33, 6144, 60, 36, 309, 519, 39, 69, 1560, 42, 210, 75, 45, 225, 135, 48, 84, 144, 51, 150, 90, 54, 159, 450, 57, 99, 6144, 60, 294, 105, 63
Offset: 0

Views

Author

Nicholas Drozd, Dec 03 2021

Keywords

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.

Examples

			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.
		

Crossrefs

Cf. A010872, A349877, A349896 (record values), A353313, A353314.
Cf. also A006370.

Programs

  • 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 *)
  • PARI
    a(n) = my(d=divrem(n, 3)); if (d[2], a(5*d[1]+d[2]+3), n); \\ Michel Marcus, Dec 05 2021
  • Python
    def a(n):
        while True:
            quot, rem = divmod(n, 3)
            if rem == 0:
                return n
            n = (5 * quot) + rem + 3
    

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

Extensions

Formal escape clause added to the definition by Antti Karttunen, Apr 14 2022