login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A078720 Integer part of the ratio of even to odd terms among n, f(n), f(f(n)), ...., 1 for the Collatz function (that is, until reaching "1" for the first time), or -1 if 1 is never reached. 1
0, 1, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 5, 2, 2, 2, 2, 2, 2, 1, 3, 1, 3, 2, 2, 2, 2, 1, 3, 2, 2, 2, 3, 3, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 6, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 4, 2, 1, 1, 4, 4, 2, 2, 2, 2, 2, 1, 2, 2, 1, 1, 3, 1, 2, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

COMMENTS

1. The Collatz function (related to the "3x+1 problem") is defined by: f(n) = n/2 if n is even; f(n) = 3n + 1 if n is odd. A famous conjecture states that n, f(n), f(f(n)), .... eventually reaches 1. 2. It appears that a(n) > 0 for all n. The mean of {a(1), a(2), ...., a(N)} seems to be close to 3/2 for large N. That is, there are about 3 even to 2 odd terms in N, f(N), f(f(N)), ...., 1. Hence f1(n) = n/2 will be applied about three times and f2(n) = 3n+1 about two times, in N, f(N), f(f(N)), ...., 1. Heuristically, one can see why 1 must eventually be reached by N, f(N), f(f(N)), .... For example, considering a sample sequence of 3 applications of f1 and 2 applications of f2: f1(f1(f1(f2(f2(N))))) = (9/32)N + 5/16, which makes N much smaller.

LINKS

Table of n, a(n) for n=1..100.

Index entries for sequences related to 3x+1 (or Collatz) problem

EXAMPLE

The terms n, f(n), f(f(n)), ...., 1 for n = 12 are: 12, 6, 3, 10, 5, 16, 8, 4, 2, 1, of which 7 are even and 3 are odd. Hence a(12) = Floor(7/3) = 2.

MATHEMATICA

f[n_] := Module[{a, i, o}, i = n; o = 1; a = {}; While[i > 1, If[Mod[i, 2] == 1, o = o + 1]; a = Append[a, i]; i = f[i]]; o]; Table[f[i], {i, 1, 100}]

CROSSREFS

Cf. A078719.

Sequence in context: A214707 A083039 A106253 * A270488 A083898 A078314

Adjacent sequences:  A078717 A078718 A078719 * A078721 A078722 A078723

KEYWORD

nonn

AUTHOR

Joseph L. Pe, Dec 20 2002

EXTENSIONS

Escape clause added to definition by N. J. A. Sloane, Jun 06 2017

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 15 00:02 EDT 2019. Contains 328025 sequences. (Running on oeis4.)