login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of odd-then-even runs to reach 1 from n under the modified "3x+1" map: x -> x/2 if x is even, x -> (3x+1)/2 if x is odd.
3

%I #53 Jul 11 2023 12:04:48

%S 0,1,1,1,1,2,3,1,4,2,3,2,2,4,2,1,3,5,4,2,1,4,2,2,5,3,17,4,4,3,16,1,6,

%T 4,2,5,4,5,6,2,17,2,6,4,4,3,16,2,5,6,5,3,2,18,17,4,7,5,6,3,3,17,15,1,

%U 6,7,5,4,3,3,16,5,18,5,2,5,5,7,6,2,4,18,17

%N Number of odd-then-even runs to reach 1 from n under the modified "3x+1" map: x -> x/2 if x is even, x -> (3x+1)/2 if x is odd.

%C The 2->1 step is not counted.

%C From _Dustin Theriault_, May 24 2023: (Start)

%C The ratio of the partial sum of a(n) to the partial sum of A006577(n) appears to approach 1/6 (observation for n = 1..10^10).

%C The ratio of the partial sum of a(n) to the partial sum of A286380(n) appears to approach 1/2 (observation for n = 1..10^10). (End)

%H Michael De Vlieger, <a href="/A160541/b160541.txt">Table of n, a(n) for n = 1..10000</a>

%H Francis Laclé, <a href="https://hal.archives-ouvertes.fr/hal-03201180v2">2-adic parity explorations of the 3n+1 problem</a>, hal-03201180v2 [cs.DM], 2021.

%H Dustin Theriault, <a href="/A160541/a160541.png">Ratio between the partial sum of a(n) to the partial sum of A006577(n), for n = 1..10^10</a>.

%H Dustin Theriault, <a href="/A160541/a160541_2.png">Ratio between the partial sum of a(n) to the partial sum of A286380(n), for n = 1..10^10</a>.

%H Dustin Theriault, <a href="/A160541/a160541_1.png">Histogram of a(n), for n = 1..10^10</a>.

%H Dustin Theriault, <a href="/A160541/a160541_3.png">Combined histograms of A006577, A286380, A160541, for n = 1..10^9</a>.

%F Number of steps x -> A363270(x) to go from n to 1. - _Dustin Theriault_, Jul 09 2023

%e 7->11->17->26->13->20->10->5->8->4->2->1, so the odd-then-even runs are (7->11->17->26) (13->20->10) (5->8->4->2), and a(7) is 3.

%t Array[Length@ Split[Most@ NestWhileList[If[EvenQ@ #, #/2, (3 # + 1)/2] &, #, # > 1 &], Or[OddQ[#1], EvenQ[#2]] &] &, 120] (* Corrected by _Michael De Vlieger_, Jul 19 2021 *)

%o (C) int a(int n) {

%o int steps = 0;

%o while (n > 1) {

%o while (n & 1) n += (n >> 1) + 1;

%o while (!(n & 1)) n >>= 1;

%o ++steps;

%o }

%o return steps;

%o } /* _Dustin Theriault_, May 23 2023 */

%Y Cf. A006577, A286380, A363270.

%K nonn

%O 1,6

%A Brenton Bostick (bostick(AT)gmail.com), May 18 2009