|
|
A102419
|
|
"Dropping time" in 3x+1 problem starting at n (number of steps to reach a lower number than starting value); a(1) = 0 by convention. Also called glide(n).
|
|
9
|
|
|
0, 1, 6, 1, 3, 1, 11, 1, 3, 1, 8, 1, 3, 1, 11, 1, 3, 1, 6, 1, 3, 1, 8, 1, 3, 1, 96, 1, 3, 1, 91, 1, 3, 1, 6, 1, 3, 1, 13, 1, 3, 1, 8, 1, 3, 1, 88, 1, 3, 1, 6, 1, 3, 1, 8, 1, 3, 1, 11, 1, 3, 1, 88, 1, 3, 1, 6, 1, 3, 1, 83, 1, 3, 1, 8, 1, 3, 1, 13, 1, 3, 1, 6, 1, 3, 1, 8, 1, 3, 1, 73, 1, 3, 1, 13, 1, 3, 1, 6
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
1: 0 steps
2 1: 1 step
3 10 5 16 8 4 2 1: 6 steps (before it drops below n)
4 2 1: 1 step
5 16 8 4 2 1: 3 steps
6 3 ...: 1 step
7 22 11 34 17 52 26 13 40 20 10 5 ...: 11 steps
...
Records: 0.1.6.11.96.132...171... (A217934)
at.......1.2.3..7.27.703.10087... (A060412)
|
|
MATHEMATICA
|
Prepend[Table[Length[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>=n&]], {n, 2, 99}], 1]-1 (* Jayanta Basu, May 28 2013 *)
|
|
PROG
|
(Python)
def a(n):
if n<3: return n - 1
N=n
x=0
while True:
if n%2==0: n//=2
else: n = 3*n + 1
x+=1
if n<N: return x
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|