cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A376079 a(n) is the largest difference of adjacent elements in the sorted list of the Collatz trajectory elements of n.

Original entry on oeis.org

1, 6, 2, 8, 6, 12, 4, 12, 6, 12, 4, 20, 12, 54, 8, 14, 12, 30, 6, 32, 12, 54, 8, 18, 14, 1944, 12, 36, 54, 1944, 16, 18, 12, 54, 12, 56, 30, 66, 20, 1944, 22, 48, 8, 68, 54, 1944, 24, 38, 18, 78, 14, 80, 1944, 1944, 12, 24, 30, 66, 54, 54, 1944, 1944, 32, 48, 12
Offset: 2

Views

Author

Markus Sigg, Sep 09 2024

Keywords

Comments

Trajectories end when they reach 1.

Examples

			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.
		

Crossrefs

Cf. A220237 (sorted trajectory), A008908, A025586.

Programs

  • Mathematica
    Table[Max[Differences[Sort[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&]]]],{n,2,70}] (* Harvey P. Dale, Aug 24 2025 *)
  • 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]));