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 A160266 #17 Aug 28 2024 09:32:58 %S A160266 2,1,1,2,4,2,1,1,6,1,2,1,1,5,1,1,1,6,1,4,3,1,2,1,1,2,1,1,10,5,1,1,8,1, %T A160266 1,1,1,1,2,1,40,1,1,1,1,1,6,3,1,7,17,1,36,1,1,2,1,1,1,20,1,1,1,1,8,1, %U A160266 1,18,13,1,5,1,2,6,1,1,1,1,1,1,6,1,9,11,2,9,1,2,9,4,6,1,1,1,9,7,1,7,29,2,2,1 %N A160266 Let f and its k-fold iteration f^k be defined as in A159885. a(n) is the least k for which A006694( (f^k(2n+1)-1)/2 ) < A006694(n). %C A160266 Conjecture. For every n>=1, there exists a finite value of a(n). It is easy to see that this conjecture is equivalent to the well known Collatz 3n+1 conjecture. %H A160266 Antti Karttunen, <a href="/A160266/b160266.txt">Table of n, a(n) for n = 1..65537</a> %H A160266 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %p A160266 A006519 := proc(n) local i ; for i in ifactors(n)[2] do if op(1,i) = 2 then return op(1,i)^op(2,i) ; fi ; od: return 1 ; end proc: %p A160266 f := proc(twon1) local threen2 ; threen2 := 3*twon1/2+1/2 ; threen2/A006519(threen2) ; end proc: %p A160266 A160266 := proc(n) local ref,k,fk ; ref := A006694(n) ; k := 1 ; fk := f(2*n+1) ; while true do if A006694( (fk-1)/2 ) < ref then return k; end if; fk := f(fk) ; k := k+1 ; end do ; end proc: %p A160266 seq(A160266(n),n=1..120) ; # _R. J. Mathar_, Feb 02 2010 %t A160266 A006519[n_] := Do[If[fi[[1]] == 2, Return[2^fi[[2]]], Return[1]], {fi, FactorInteger[n]}]; %t A160266 f[n_] := With[{n2 = 3 n/2 + 1/2}, n2/A006519[n2]]; %t A160266 A006694[n_] := Sum[EulerPhi[d]/MultiplicativeOrder[2, d], {d, Divisors[2n + 1]}] - 1; %t A160266 a[n_] := Module[{ref, k, fk}, ref = A006694[n]; k = 1; fk = f[2n + 1]; While[True, If[A006694[(fk - 1)/2] < ref, Return[k]]; fk = f[fk]; k++]]; %t A160266 Table[a[n], {n, 1, 105}] (* _Jean-François Alcover_, Aug 28 2024, after _R. J. Mathar_ *) %o A160266 (PARI) %o A160266 f(n) = ((3*((n-1)/2))+2)/A006519((3*((n-1)/2))+2); %o A160266 A006519(n) = (1<<valuation(n, 2)); %o A160266 A006694(n) = (sumdiv(2*n+1, d, eulerphi(d)/znorder(Mod(2, d))) - 1); \\ From A006694 %o A160266 A160266(n) = { my(w=A006694(n), n = (n+n+1), k=0); while(A006694((n-1)/2) >= w, k++; n = f(n)); (k); }; \\ _Antti Karttunen_, Sep 22 2018 %Y A160266 Cf. A006694, A159885, A159945, A160198, A122458, A160267. %K A160266 nonn,look %O A160266 1,1 %A A160266 _Vladimir Shevelev_, May 07 2009 %E A160266 More terms from _R. J. Mathar_, Feb 02 2010