A160541 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.
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, 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, 6, 7, 5, 4, 3, 3, 16, 5, 18, 5, 2, 5, 5, 7, 6, 2, 4, 18, 17
Offset: 1
Keywords
Examples
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.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Francis Laclé, 2-adic parity explorations of the 3n+1 problem, hal-03201180v2 [cs.DM], 2021.
- Dustin Theriault, Ratio between the partial sum of a(n) to the partial sum of A006577(n), for n = 1..10^10.
- Dustin Theriault, Ratio between the partial sum of a(n) to the partial sum of A286380(n), for n = 1..10^10.
- Dustin Theriault, Histogram of a(n), for n = 1..10^10.
- Dustin Theriault, Combined histograms of A006577, A286380, A160541, for n = 1..10^9.
Programs
-
C
int a(int n) { int steps = 0; while (n > 1) { while (n & 1) n += (n >> 1) + 1; while (!(n & 1)) n >>= 1; ++steps; } return steps; } /* Dustin Theriault, May 23 2023 */
-
Mathematica
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 *)
Formula
From Alan Michael Gómez Calderón, Mar 19 2025: (Start)
a(n) = a(A363270(n)) + 1 for n >= 2. (End)
Comments