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!)
 A055509 Number of odd primes in sequence obtained in 3x+1 (or Collatz) problem starting at n. 8
 0, 0, 2, 0, 1, 2, 5, 0, 5, 1, 4, 2, 2, 5, 3, 0, 3, 5, 6, 1, 0, 4, 3, 2, 6, 2, 24, 5, 5, 3, 23, 0, 6, 3, 2, 5, 6, 6, 10, 1, 24, 0, 7, 4, 3, 3, 22, 2, 6, 6, 5, 2, 2, 24, 23, 5, 7, 5, 10, 3, 4, 23, 19, 0, 6, 6, 8, 3, 2, 2, 21, 5, 24, 6, 1, 6, 5, 10, 10, 1, 4, 24, 23, 0, 0, 7, 8, 4, 9, 3, 19, 3, 2, 22, 19 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 LINKS Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 Eric Weisstein's World of Mathematics, Collatz Problem Wikipedia, Collatz conjecture FORMULA a(n) = A078350(n) - 1 for n > 1. a(A196871(n)) = 0. - Reinhard Zumkeller, Oct 08 2011 From Robert Israel, Dec 05 2017: (Start) If n is odd, a(n) = a(3*n+1) + A010051(n). If n is even, a(n) = a(n/2). (End) MAPLE g:= proc(n) option remember;    local x;    x:= 3*n+1;    x:= x/2^padic:-ordp(x, 2);    if isprime(n) then procname(x)+1 else procname(x) fi end proc: g(1):= 0: seq(g(n/2^padic:-ordp(n, 2)), n=1..100); # Robert Israel, Dec 05 2017 MATHEMATICA Join[{0}, Table[Count[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &], _?PrimeQ] - 1, {n, 2, 94}]] (* Jayanta Basu, Jun 15 2013 *) PROG (Haskell) a055509 n = sum \$ map a010051 \$ takeWhile (> 2) \$ iterate a006370 n -- Reinhard Zumkeller, Oct 08 2011 (PARI) A078350(n, c=0)={while(1>=valuation(n, 2), isprime(n)&&c++; n=n*3+1); c} \\ M. F. Hasler, Dec 05 2017 CROSSREFS Cf. A055510. Cf. A006370, A010051. Sequence in context: A025247 A127767 A292577 * A006667 A112570 A127755 Adjacent sequences:  A055506 A055507 A055508 * A055510 A055511 A055512 KEYWORD nonn AUTHOR G. L. Honaker, Jr., Jun 30 2000 EXTENSIONS More terms from Larry Reeves (larryr(AT)acm.org), Aug 09 2001 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 May 27 05:48 EDT 2020. Contains 334649 sequences. (Running on oeis4.)