%I #34 Aug 02 2018 07:19:18
%S 4,5,6,11,14,15,18,19,25,33,43,57,59,78,79,105,135,139,185,187,191,
%T 246,247,249,254,255,329,338,339,359,427,438,439,443,450,451,478,479,
%U 569,585,590,591,601,636,637,638,758,759,767,779,786,787,801,849,850,851
%N Seed values of hailstone sequences for which, by the time they first reach 1, the ratio of odd terms to even terms is exactly 1/2. (The seed value itself is included in the ratio calculation.)
%C 1/2 is the most common odd/even ratio for these sequences. For seed values from 2 to 2^17, it is the odd/even ratio for 4454 of those sequences. The next most common ratio is 5/11, with 1834 sequences. (This is all empirical observation, using Mathematica.)
%H Matt Enlow, <a href="/A316783/b316783.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%F { k : A006666(k)/A078719(k) = 2 }. - _Alois P. Heinz_, Aug 02 2018
%e The hailstone sequence starting with 11 (and ending at 1) is 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1. Five of those terms are odd, and the other ten are even, giving an odd/even ratio of 1/2. Therefore 11 is a term in this sequence.
%p b:= proc(n) option remember; `if`(n=1, [1, 0],
%p `if`(n::odd, [1, 0]+b(3*n+1), [0, 1]+b(n/2)))
%p end:
%p a:= proc(n) option remember; local k; for k from a(n-1)
%p +1 while (l-> 2*l[1]<>l[2])(b(k)) do od; k
%p end: a(0):=0:
%p seq(a(n), n=1..100); # _Alois P. Heinz_, Aug 02 2018
%t collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1]&, n, # != 1 &];
%t A316783 = Select[Range[2, 1000], With[{c = Mod[collatz[#], 2]}, 2 Total[c] == Total[1 - c]] &]
%o (PARI) is(n) = my(x=n, even=0, odd=0); while(1, if(x%2==0, x=x/2; even++, x=3*x+1; odd++); if(x==1, odd++; break)); odd/even==1/2 \\ _Felix Fröhlich_, Jul 13 2018
%Y Cf. A006370, A006666, A078719.
%K nonn
%O 1,1
%A _Matt Enlow_, Jul 13 2018