The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A135282 Largest k such that 2^k appears in the trajectory of the Collatz 3x+1 sequence started at n. 9
 0, 1, 4, 2, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 4, 6, 8, 4, 4 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS Most of the first eighty terms in the sequence are 4, because the trajectories finish with 16 -> 8 -> 4 -> 2 -> 1. - R. J. Mathar, Dec 12 2007 Most of the first ten thousand terms are 4, and there only appear 4, 6, 8, and 10 in the extent, unless n is power of 2. In the other words, it seems that the trajectory of the Collatz 3x + 1 sequence ends with either 16, 64, 256 or 1024. There are few exceptional terms, for example a(10920) = 12, a(10922) = 14. It also seems all terms are even unless n is an odd power of 2. - Masahiko Shin, Mar 16 2010 It is true that all terms are even unless n is an odd power of 2: 2 == -1 mod 3, 2 * 2 == -1 * -1 == 1 mod 3. Therefore only even-indexed powers of 2 are congruent to 1 mod 3 and thus reachable by either a halving step or a "tripling step," whereas the odd-indexed powers of 2 are only reachable by a halving step or as an initial value. - Alonso del Arte, Aug 15 2010 LINKS T. D. Noe, Table of n, a(n) for n = 1..10000 EXAMPLE a(6) = 4 because the sequence is 6, 3, 10, 5, 16, 8, 4, 2, 1; there 16 = 2^4 is the largest power of 2 encountered. MAPLE A135282 := proc(n) local k, threen1 ; k := 0 : threen1 := n ; while threen1 > 1 do if 2^ilog(threen1) = threen1 then k := max(k, ilog(threen1)) ; fi ; if threen1 mod 2 = 0 then threen1 := threen1/2 ; else threen1 := 3*threen1+1 ; fi ; od: RETURN(k) ; end: for n from 1 to 80 do printf("%d, ", A135282(n)) ; od: # R. J. Mathar, Dec 12 2007 MATHEMATICA Collatz[n_] := If[EvenQ[n], n/2, 3*n + 1]; Log[2, Table[NestWhile[Collatz, n, ! IntegerQ[Log[2, #]] &], {n, 100}]] (* T. D. Noe, Mar 05 2012 *) PROG (C) #include int main(){ int i, s, f; for(i = 2; i < 10000; i++){ f = 0; s = i; while(s != 1){ if(s % 2 == 0){ s = s/2; f++; } else{ f = 0; s = 3 * s + 1; } } printf("%d, ", f); } return 0; } /* Masahiko Shin, Mar 16 2010 */ (Haskell) a135282 = a007814 . head . filter ((== 1) . a209229) . a070165_row -- Reinhard Zumkeller, Jan 02 2013 CROSSREFS Cf. A007814, A209229, A070165, A232503. Sequence in context: A232715 A317951 A095382 * A347409 A179411 A103859 Adjacent sequences:  A135279 A135280 A135281 * A135283 A135284 A135285 KEYWORD nonn AUTHOR Masahiko Shin, Dec 02 2007 EXTENSIONS Edited and extended by R. J. Mathar, Dec 12 2007 More terms from Masahiko Shin, Mar 16 2010 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified October 19 19:44 EDT 2021. Contains 348091 sequences. (Running on oeis4.)