|
Search: id:A127885
|
|
|
| A127885 |
|
a(n) = minimal number of steps to get from n to 1, where is a step is: x -> 3x+1 if x is odd, or x -> either x/2 or 3x+1 if x is even. |
|
+0 8
|
|
| 0, 1, 7, 2, 5, 8, 16, 3, 11, 6, 14, 9, 9, 17, 17, 4, 12, 12, 20, 7, 7, 15, 15, 10, 23, 10, 23, 10, 18, 18, 31, 5, 18, 13, 13, 13, 13, 21, 26, 8, 21, 8, 21, 16, 16, 16, 29, 11, 16, 16, 24, 11, 11, 24, 24, 11, 24, 19, 24, 19, 19, 32, 32, 6, 19, 19, 27, 14, 14, 14, 27, 14, 27, 14, 14, 22, 22, 27, 27, 9, 22, 22, 22, 9, 9, 22, 22, 17, 22, 17, 30, 17, 17, 30, 30, 12, 30, 17, 17, 17
(list; graph; listen)
|
|
|
OFFSET
|
1,3
|
|
|
COMMENT
|
In contrast to the "3x+1" problem (see A006577), here you are free to chose either step if x is even.
See A125731 for the number of steps in the reverse direction, from 1 to n
|
|
LINKS
|
David Applegate, Table of n, a(n) for n = 1..1000
|
|
EXAMPLE
|
Several early values use the path:
6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
The first path where choosing 3x+1 for even x helps is:
9 -> 28 -> 85 -> 256 -> 128 -> 64 -> 32 -> 16 -> 8 -> 4 -> 2 -> 1
|
|
MAPLE
|
# Maple code from David Applegate: Be careful - the function takes an iteration limit and returns the limit
# if it wasn't able to determine the answer (that is, if A127885(n, lim)
# == lim, all you know is that the value is >= lim). To use it, do
# manual iteration on the limit.
A127885 := proc(n, lim) local d, d2; options remember;
if (n = 1) then return 0; end if;
if (lim <= 0) then return 0; end if;
if (n > 2 ^ lim) then return lim; end if;
if (n mod 2 = 0) then
d := A127885(n/2, lim-1);
d2 := A127885(3*n+1, d);
if (d2 < d) then d := d2; end if;
else
d := A127885(3*n+1, lim-1);
end if;
return 1+d;
end proc;
|
|
CROSSREFS
|
A127886 gives the difference between A006577 and this sequence.
Cf. A006577, A125731, A127887, A125195, A125686, A125719.
Sequence in context: A066903 A074457 A072761 this_sequence A006577 A073652 A117029
Adjacent sequences: A127882 A127883 A127884 this_sequence A127886 A127887 A127888
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
David Applegate (david(AT)research.att.com) and N. J. A. Sloane (njas(AT)research.att.com), Feb 04 2007
|
|
|
Search completed in 0.002 seconds
|