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.

A329535 Numbers with twice as many halving steps before reaching 1 in the 3x + 1 problem as tripling steps.

This page as a plain text file.
%I A329535 #28 Feb 11 2020 12:04:31
%S A329535 1,159,283,377,502,503,603,615,668,669,670,799,807,888,890,892,893,
%T A329535 1063,1065,1095,1186,1187,1188,1189,1190,1417,1435,1580,1581,1582,
%U A329535 1585,1586,1587,1889,1913,1947,1959,1963,2104,2106,2108,2109,2113,2114,2115,2119,2518
%N A329535 Numbers with twice as many halving steps before reaching 1 in the 3x + 1 problem as tripling steps.
%C A329535 Essentially the same as A281665. - _R. J. Mathar_, Feb 07 2020
%C A329535 Numbers m such that A006666(m) = 2 * A006667(m).
%C A329535 Steps after reaching 1 the first time are ignored. For example, for 5, 16, 8, 4, 2, 1, 4, 2, 1, ..., only 8, 4, 2, 1 are counted for halving steps, the subsequent 4, 2, 1 subcycles are ignored.
%e A329535 159 is in the sequence because its trajectory, 159, 478, 239, 718, ..., has 36 halving steps and 18 tripling steps.
%e A329535 160 is not in the sequence because its trajectory, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1, has nine even terms but only two odd terms.
%t A329535 collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 50; t = {}; n = 0; While[Length[t] < nn, n++; c = collatz[n]; ev = Length[Select[c, EvenQ]]; od = Length[c] - ev - 1; If[ev == 2 * od, AppendTo[t, n]]]; t
%o A329535 (Scala) def halfTripleCompare(n: Int): Int = {
%o A329535   var curr = n
%o A329535   var htc = 0
%o A329535   while (curr > 1) {
%o A329535     curr = (curr % 2) match {
%o A329535       case 0 => htc = htc + 1
%o A329535         curr / 2
%o A329535       case 1 => htc = htc - 2
%o A329535         3 * curr + 1
%o A329535     }
%o A329535   }
%o A329535   htc
%o A329535 }
%o A329535 (1 to 1000).filter(halfTripleCompare(_) == 0) // _Alonso del Arte_, Nov 18 2019
%Y A329535 Cf. A006666, A006667.
%K A329535 nonn
%O A329535 1,2
%A A329535 _Michel Lagneau_, Nov 16 2019