cp's OEIS Frontend

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.

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.

This page as a plain text file.
%I A078720 #8 Jun 06 2017 00:12:22
%S A078720 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,
%T A078720 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,
%U A078720 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
%N 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.
%C A078720 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.
%H A078720 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%e A078720 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.
%t A078720 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}]
%Y A078720 Cf. A078719.
%K A078720 nonn
%O A078720 1,4
%A A078720 _Joseph L. Pe_, Dec 20 2002
%E A078720 Escape clause added to definition by _N. J. A. Sloane_, Jun 06 2017