login
3x + 1 sequence starting at 75.
4

%I #41 Sep 08 2022 08:46:12

%S 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,

%T 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,

%U 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

%N 3x + 1 sequence starting at 75.

%C a(n) gives the value obtained after n iterations of the Collatz function starting at 75. - _Daniel Forgues_, May 19 2015

%C 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

%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>

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

%e 75 is odd, so it's followed by 3*75 + 1 = 226.

%e 226 is even, so it's followed by 226/2 = 113.

%t NestList[If[EvenQ[#], #/2, 3# + 1] &, 75, 100]

%o (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

%o (Sage)

%o def collatz(start):

%o a = start

%o while True:

%o yield a

%o a = 3*a + 1 if is_odd(a) else a/2

%o A258056 = collatz(75)

%o [next(A258056) for _ in range(60)] # _Peter Luschny_, May 22 2015

%Y Cf. A033478, A153727.

%Y Row 75 of A347270.

%K nonn,easy

%O 0,1

%A _Alonso del Arte_, May 17 2015