OFFSET
2,2
COMMENTS
Trajectories end when they reach 1.
LINKS
Markus Sigg, Table of n, a(n) for n = 2..10001
EXAMPLE
The trajectory of 3 is (3,10,5,16,8,4,2,1), the sorted list of the trajectory elements is (1,2,3,4,5,8,10,16), the list of differences is (1,1,1,1,3,2,6) with maximum 6, so a(3) = 6.
PROG
(PARI) a(n) = my(L = List([n])); while(n > 1, n = if(n % 2 == 0, n/2, 3*n + 1); listput(L, n)); listsort(L); vecmax(vector(#L - 1, i, L[i+1] - L[i]));
CROSSREFS
KEYWORD
nonn
AUTHOR
Markus Sigg, Sep 09 2024
STATUS
approved