|
|
A290101
|
|
a(n) = dropping time for the modified Collatz problem, where x -> 3x+1 if x is odd, and x -> either x/2 or 3x+1 if x is even (minimal number of any such steps to reach a lower number than the starting value n); a(1) = 0 by convention.
|
|
4
|
|
|
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, 16, 1, 3, 1, 19, 1, 3, 1, 6, 1, 3, 1, 11, 1, 3, 1, 8, 1, 3, 1, 16, 1, 3, 1, 6, 1, 3, 1, 8, 1, 3, 1, 11, 1, 3, 1, 19, 1, 3, 1, 6, 1, 3, 1, 13, 1, 3, 1, 8, 1, 3, 1, 13, 1, 3, 1, 6, 1, 3, 1, 8, 1, 3, 1, 11, 1, 3, 1, 13, 1, 3, 1, 6, 1, 3, 1, 16, 1, 3, 1, 8, 1, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
In contrast to the "3x+1" problem (see A006577, A102419), here you are free to choose either step if x is even. The sequence counts the minimum number of optimally chosen steps which leads to a value smaller than the value we started from.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
Starting from n = 27, the following is a shortest path leading to a value smaller than 27: 27 -> 82 -> 41 -> 124 -> 373 -> 1120 -> 560 -> 280 -> 140 -> 70 -> 35 -> 106 -> 53 -> 160 -> 80 -> 40 -> 20. It has 16 steps, thus a(27) = 16. Note the 3x+1 step from 124 to 373 which is not allowed in the ordinary Collatz problem.
|
|
PROG
|
(PARI) A290101(n) = { if(1==n, return(0)); my(S, k); S=[n]; k=0; while( S[1]>=n, k++; S=vecsort( concat(apply(x->3*x+1, S), apply(x->x\2, select(x->x%2==0, S) )), , 8); ); k } \\ After Max Alekseyev's code for A127885
(Python)
from sympy import flatten
def ok(n, L):
return any(i < n for i in L)
def a(n):
if n==1: return 0
L=[n]
i = 0
while not ok(n, L):
L=set(flatten([[3*k + 1, k//2] if k%2==0 else 3*k + 1 for k in L]))
i+=1
return i
|
|
CROSSREFS
|
Differs from A102419 for the first time at n=27, where a(27) = 16, while A102419(27) = 96.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|