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 A220071 #42 Jan 31 2025 09:31:01 %S A220071 0,1,3,2,3,4,6,3,7,4,6,5,5,7,7,4,6,8,8,5,5,7,7,6,9,6,29,8,8,8,28,5,10, %T A220071 7,7,9,9,9,12,6,29,6,11,8,8,8,28,7,10,10,10,7,7,30,30,9,12,9,12,9,9, %U A220071 29,29,6,11,11,11,8,8,8,28,10,31,10,8,10,10,13 %N A220071 Difference between number of halving steps and number of tripling steps needed to reach 1 in '3x+1' problem. %C A220071 This sequence can also be defined as: a(1) = 0; thereafter a(2*k) = a(k) + 1, a(2*k+1) = a(6*k+4) - 1. - _Gionata Neri_, Jul 17 2016 %H A220071 Alois P. Heinz, <a href="/A220071/b220071.txt">Table of n, a(n) for n = 1..10000</a> %F A220071 a(n) = A006666(n) - A006667(n). %F A220071 a(n) = a(A085062(n)) + 1 for n >= 2. - _Alan Michael Gómez Calderón_, Jan 26 2025 %p A220071 a:= proc(n) option remember; `if`(n<2, 0, %p A220071 `if`(irem(n, 2)=0, 1+a(n/2), a((3*n+1)/2))) %p A220071 end: %p A220071 seq(a(n), n=1..100); # _Alois P. Heinz_, Feb 19 2013 %t A220071 coll[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[(x = Count[coll[n], _?EvenQ]) - (Length[coll[n]] - x - 1), {n, 78}] (* _Jayanta Basu_, Aug 15 2013 *) %Y A220071 Cf. A006577, A006666, A006667, A014682. %K A220071 nonn %O A220071 1,3 %A A220071 _Jayanta Basu_, Feb 19 2013 %E A220071 More terms from _Alois P. Heinz_, Feb 19 2013