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 A290101 #22 May 15 2021 10:34:24 %S A290101 0,1,6,1,3,1,11,1,3,1,8,1,3,1,11,1,3,1,6,1,3,1,8,1,3,1,16,1,3,1,19,1, %T A290101 3,1,6,1,3,1,11,1,3,1,8,1,3,1,16,1,3,1,6,1,3,1,8,1,3,1,11,1,3,1,19,1, %U A290101 3,1,6,1,3,1,13,1,3,1,8,1,3,1,13,1,3,1,6,1,3,1,8,1,3,1,11,1,3,1,13,1,3,1,6,1,3,1,16,1,3,1,8,1,3 %N A290101 a(n) = dropping time for the modified Collatz problem, where x -> 3x+1 if x is odd, and x -> either x/2 or 3x+1 if x is even (minimal number of any such steps to reach a lower number than the starting value n); a(1) = 0 by convention. %C A290101 In contrast to the "3x+1" problem (see A006577, A102419), here you are free to choose either step if x is even. The sequence counts the minimum number of optimally chosen steps which leads to a value smaller than the value we started from. %H A290101 Antti Karttunen, <a href="/A290101/b290101.txt">Table of n, a(n) for n = 1..10000</a> %H A290101 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %F A290101 a(n) <= A102419(n). %F A290101 a(n) <= A127885(n) [apart from any hypothetical -1's in A127885]. %e A290101 Starting from n = 27, the following is a shortest path leading to a value smaller than 27: 27 -> 82 -> 41 -> 124 -> 373 -> 1120 -> 560 -> 280 -> 140 -> 70 -> 35 -> 106 -> 53 -> 160 -> 80 -> 40 -> 20. It has 16 steps, thus a(27) = 16. Note the 3x+1 step from 124 to 373 which is not allowed in the ordinary Collatz problem. %o A290101 (PARI) A290101(n) = { if(1==n,return(0)); my(S, k); S=[n]; k=0; while( S[1]>=n, k++; S=vecsort( concat(apply(x->3*x+1, S), apply(x->x\2, select(x->x%2==0, S) )), , 8); ); k } \\ After _Max Alekseyev_'s code for A127885 %o A290101 (Python) %o A290101 from sympy import flatten %o A290101 def ok(n, L): %o A290101 return any(i < n for i in L) %o A290101 def a(n): %o A290101 if n==1: return 0 %o A290101 L=[n] %o A290101 i = 0 %o A290101 while not ok(n, L): %o A290101 L=set(flatten([[3*k + 1, k//2] if k%2==0 else 3*k + 1 for k in L])) %o A290101 i+=1 %o A290101 return i %o A290101 print([a(n) for n in range(1, 121)]) # _Indranil Ghosh_, Aug 31 2017 %Y A290101 Cf. A127885, A290100, A290102, A000012 (even bisection). %Y A290101 Differs from A102419 for the first time at n=27, where a(27) = 16, while A102419(27) = 96. %K A290101 nonn %O A290101 1,3 %A A290101 _Antti Karttunen_, Aug 20 2017