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 A279909 #23 Jun 16 2025 09:12:05 %S A279909 0,2,1,3,3,3,2,8,3,4,4,7,4,6,3,11,9,6,4,15,5,12,5,11,8,6,5,7,7,14,4, %T A279909 18,11,10,10,11,7,9,5,11,16,6,6,15,13,12,6,17,12,9,9,11,7,11,6,19,8,8, %U A279909 8,11,15,14,5,24,19,14,11,13,11,13,11,16,12,8,8,10,10,10,6,16,11,17,17,18,7,26,7,24,16,11,14,13,13,15,7,23,18,14,13,23 %N A279909 Number of steps to reach 1 or a cycle in the Collatz-like problem '3x/2' and '(x-1)/2'. %C A279909 This Collatz-like problem is as follows: start with any number n. If n is even, divide it by 2 and multiply by 3, otherwise subtract 1 and divide it by 2. %C A279909 The iteration always reach {1} or the cycles {4, 6, 9} and {16 , 24 , 36 , 54 , 81 , 40 , 60 , 90 , 135 , 67 , 33}. %H A279909 Luca Petrone, <a href="/A279909/b279909.txt">Table of n, a(n) for n = 1..19999</a> %H A279909 Luca Petrone, <a href="/A279909/a279909.pdf">Log Plot for the first million terms</a> %o A279909 (Python) %o A279909 def a(n): %o A279909 if n==1: return 0 %o A279909 l=[n] %o A279909 while True: %o A279909 if n%2==0: n=(n//2)*3 %o A279909 else: n = (n - 1)//2 %o A279909 if not n in l: %o A279909 l+=[n] %o A279909 if n<2: break %o A279909 else: break %o A279909 if l[-1]==1: return len(l)-1 %o A279909 return len(l) %o A279909 for n in range(1, 20001): %o A279909 print(n, a(n)) # _Indranil Ghosh_, Apr 13 2017 %Y A279909 Cf. A006577. %K A279909 nonn,easy %O A279909 1,2 %A A279909 _Luca Petrone_, Apr 11 2017