login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 3
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 (list; graph; refs; listen; history; text; internal format)
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
Francis Laclé, 2-adic parity explorations of the 3n+1 problem, hal-03201180v2 [cs.DM], 2021.
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
Sequence in context: A152547 A083906 A361136 * A286001 A304106 A022446
KEYWORD
nonn
AUTHOR
Brenton Bostick (bostick(AT)gmail.com), May 18 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:41 EDT 2024. Contains 371964 sequences. (Running on oeis4.)