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.

This page as a plain text file.
%I A377945 #18 Jan 31 2025 23:44:21
%S A377945 1,3,9,13,15,18,19,33,49,67,73,90,109,163,391,522,607,729,810,1093,
%T A377945 1639
%N A377945 Numbers k such that the trajectory of k under the `3x-1' map reaches k+1.
%C A377945 The 3x-1 map is x -> 3x-1 if x odd, and x -> x/2 if x even (A001281).
%C A377945 There are no more terms < 10^9.
%e A377945 13 is a term because its trajectory 13 -> 38 -> 19 -> 56 -> 28 -> 14 -> ... reaches 13 + 1 = 14.
%o A377945 (Python)
%o A377945 def isok(n):
%o A377945     temp, loops = n, 0
%o A377945     while(temp != n + 1 and loops<2):
%o A377945         temp = temp // 2 if temp % 2 == 0 else 3 * temp - 1
%o A377945         if(temp == 1 or temp == 5 or temp == 17):
%o A377945             loops += 1
%o A377945     return temp == n + 1
%o A377945 print([n for n in range(1, 2000) if isok(n)])
%Y A377945 Cf. A001281.
%K A377945 nonn,more
%O A377945 1,2
%A A377945 _Kevin Ge_, Nov 11 2024