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.

A375206 T(n,k) for n >= 2, k < n is the distance of n and k in the Collatz graph, where T(n,k) is a triangle read by rows.

Original entry on oeis.org

1, 7, 6, 2, 1, 5, 5, 4, 2, 3, 8, 7, 1, 6, 3, 16, 15, 11, 14, 11, 12, 3, 2, 4, 1, 2, 5, 13, 19, 18, 14, 17, 14, 15, 3, 16, 6, 5, 1, 4, 1, 2, 10, 3, 13, 14, 13, 9, 12, 9, 10, 2, 11, 5, 8, 9, 8, 2, 7, 4, 1, 13, 6, 16, 3, 11, 9, 8, 4, 7, 4, 5, 7, 6, 10, 3, 5, 6, 17, 16, 12, 15, 12, 13, 1, 14, 2, 11, 3, 14, 8, 17, 16, 12, 15, 12, 13, 17, 14, 20, 11, 15, 14, 10, 18
Offset: 2

Views

Author

Markus Sigg, Oct 16 2024

Keywords

Comments

The restriction k < n is there to avoid the trivial values T(n,n) = 0. Consequently, the first term is T(2,1).

Examples

			The triangle begins
  1,
  7, 6,
  2, 1, 5,
  5, 4, 2, 3,
  8, 7, 1, 6, 3,
  ...
		

Crossrefs

Programs

  • PARI
    C(n) = {
        my(L = List([n]));
        while(n > 1, n = if(n % 2 == 0, n/2, 3*n+1); listput(L, n));
        L
    };
    a375206(n,k) = {
        my(Cn = C(n), Ck = C(k));
        for(i = 1, #Cn,
            for(j = 1, #Ck,
                if(Cn[i] == Ck[j], return(i+j-2))
            )
        )
    };