OFFSET
1,136
LINKS
FORMULA
a(2^n) = 1.
EXAMPLE
a(3) = 1 because the Collatz trajectory of 3 is T = [3, 10, 5, 16, 8, 4, 2, 1], and the absolute difference triangle of the elements of T is:
3 . 10 . 5 . 16 . 8 . 4 . 2 . 1
7 . 5 . 11 . 8 . 4 . 2 . 1
2 . 6 . 3 . 4 . 2 . 1
4 . 3 . 1 . 2 . 1
1 . 2 . 1 . 1
1 . 1 . 0
0 . 1
1
with bottom entry a(3) = 1.
MATHEMATICA
Collatz[n_]:=NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>1&]; Flatten[Table[Collatz[n], {n, 10}]]; Table[d=Collatz[m]; While[Length[d]>1, d=Abs[Differences[d]]]; d[[1]], {m, 100}]
PROG
(PARI) a(n) = my(list=List([n])); while (n!=1, if(n%2, n=3*n+1, n=n/2); listput(list, n)); my(v = Vec(list)); while (#v != 1, v = vector(#v-1, k, abs(v[k+1]-v[k]))); v[1]; \\ Michel Marcus, Dec 23 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Dec 22 2022
STATUS
approved