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.

A377945 Numbers k such that the trajectory of k under the `3x-1' map reaches k+1.

Original entry on oeis.org

1, 3, 9, 13, 15, 18, 19, 33, 49, 67, 73, 90, 109, 163, 391, 522, 607, 729, 810, 1093, 1639
Offset: 1

Views

Author

Kevin Ge, Nov 11 2024

Keywords

Comments

The 3x-1 map is x -> 3x-1 if x odd, and x -> x/2 if x even (A001281).
There are no more terms < 10^9.

Examples

			13 is a term because its trajectory 13 -> 38 -> 19 -> 56 -> 28 -> 14 -> ... reaches 13 + 1 = 14.
		

Crossrefs

Cf. A001281.

Programs

  • Python
    def isok(n):
        temp, loops = n, 0
        while(temp != n + 1 and loops<2):
            temp = temp // 2 if temp % 2 == 0 else 3 * temp - 1
            if(temp == 1 or temp == 5 or temp == 17):
                loops += 1
        return temp == n + 1
    print([n for n in range(1, 2000) if isok(n)])