OFFSET
1,6
COMMENTS
The 2->1 step is not counted.
From Dustin Theriault, May 24 2023: (Start)
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).
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)
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.
FORMULA
Number of steps x -> A363270(x) to go from n to 1. - Dustin Theriault, Jul 09 2023
EXAMPLE
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.
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 *)
PROG
(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 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Brenton Bostick (bostick(AT)gmail.com), May 18 2009
STATUS
approved