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.

A258056 3x + 1 sequence starting at 75.

Original entry on oeis.org

75, 226, 113, 340, 170, 85, 256, 128, 64, 32, 16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4
Offset: 0

Views

Author

Alonso del Arte, May 17 2015

Keywords

Comments

a(n) gives the value obtained after n iterations of the Collatz function starting at 75. - Daniel Forgues, May 19 2015
a(n) = 1 for the first time with n = 14 (14 iterations); at this point, we get the trivial (1, 4, 2) cycle... (A153727). - Daniel Forgues, May 22 2015

Examples

			75 is odd, so it's followed by 3*75 + 1 = 226.
226 is even, so it's followed by 226/2 = 113.
		

Crossrefs

Row 75 of A347270.

Programs

  • Magma
    [n eq 1 select 75 else IsOdd(Self(n-1)) select 3*Self(n-1)+1 else Self(n-1) div 2: n in [1..80]]; // Vincenzo Librandi, May 18 2015
    
  • Mathematica
    NestList[If[EvenQ[#], #/2, 3# + 1] &, 75, 100]
  • Sage
    def collatz(start):
        a = start
        while True:
            yield a
            a = 3*a + 1 if is_odd(a) else a/2
    A258056 = collatz(75)
    [next(A258056) for  in range(60)] # _Peter Luschny, May 22 2015

Formula

a(0) = 75; a(n) = 3*a(n - 1) + 1 if a(n - 1) is odd, a(n) = a(n - 1)/2 otherwise.